diff options
author | Ted Kremenek <kremenek@apple.com> | 2009-03-06 23:36:28 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2009-03-06 23:36:28 +0000 |
commit | f5ed3961d21450c4fe98a00d7170da71b485328e (patch) | |
tree | fcb67ed1270896783115fbd74afef78091b07003 /lib/Basic/IdentifierTable.cpp | |
parent | 126c011f0f00e9221ce3cd5350ac75da2d2c239d (diff) |
Handle null IdentifierInfo* in Selector::getAsString().
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66307 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/Basic/IdentifierTable.cpp')
-rw-r--r-- | lib/Basic/IdentifierTable.cpp | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/lib/Basic/IdentifierTable.cpp b/lib/Basic/IdentifierTable.cpp index bd4facd835..4e2e7005e3 100644 --- a/lib/Basic/IdentifierTable.cpp +++ b/lib/Basic/IdentifierTable.cpp @@ -349,11 +349,13 @@ std::string MultiKeywordSelector::getName() const { } std::string Selector::getAsString() const { - if (IdentifierInfo *II = getAsIdentifierInfo()) { - if (getNumArgs() == 0) - return II->getName(); + if (InfoPtr & ArgFlags) { + IdentifierInfo *II = getAsIdentifierInfo(); - std::string Res = II->getName(); + if (getNumArgs() == 0) + return II ? II->getName() : ""; + + std::string Res = II ? II->getName() : ""; Res += ":"; return Res; } |