Handle null IdentifierInfo* in Selector::getAsString().

llvm-svn: 66307
This commit is contained in:
Ted Kremenek
2009-03-06 23:36:28 +00:00
parent bbaea048b8
commit 5f080b43fa

View File

@@ -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;
}