From f5ed3961d21450c4fe98a00d7170da71b485328e Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Fri, 6 Mar 2009 23:36:28 +0000 Subject: Handle null IdentifierInfo* in Selector::getAsString(). git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@66307 91177308-0d34-0410-b5e6-96231b3b80d8 --- lib/Basic/IdentifierTable.cpp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'lib/Basic/IdentifierTable.cpp') 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; } -- cgit v1.2.3-18-g5258