aboutsummaryrefslogtreecommitdiff
path: root/lib/Basic/IdentifierTable.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/Basic/IdentifierTable.cpp')
-rw-r--r--lib/Basic/IdentifierTable.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp
index 8b74b20032..69ee090b6e 100644
--- a/lib/Basic/IdentifierTable.cpp
+++ b/lib/Basic/IdentifierTable.cpp
@@ -315,9 +315,9 @@ unsigned Selector::getNumArgs() const {
}
IdentifierInfo *Selector::getIdentifierInfoForSlot(unsigned argIndex) const {
- if (IdentifierInfo *II = getAsIdentifierInfo()) {
+ if (getIdentifierInfoFlag()) {
assert(argIndex == 0 && "illegal keyword index");
- return II;
+ return getAsIdentifierInfo();
}
// We point to a MultiKeywordSelector (pointer doesn't contain any flags).
MultiKeywordSelector *SI = reinterpret_cast<MultiKeywordSelector *>(InfoPtr);
@@ -346,6 +346,9 @@ std::string MultiKeywordSelector::getName() const {
}
std::string Selector::getAsString() const {
+ if (InfoPtr == 0)
+ return "<null selector>";
+
if (InfoPtr & ArgFlags) {
IdentifierInfo *II = getAsIdentifierInfo();