From: Ted Kremenek Date: Wed, 16 Dec 2009 06:06:43 +0000 (+0000) Subject: Teach RetainSummaryManager::getSummary(FunctionDecl* FD) that 'FD->getIdentifier... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=48c6d181dfcba412ae4b9e1dab59205913018806;p=clang Teach RetainSummaryManager::getSummary(FunctionDecl* FD) that 'FD->getIdentifier()' will not always return a non-null IdentifierInfo*. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@91512 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Analysis/CFRefCount.cpp b/lib/Analysis/CFRefCount.cpp index 9639ad98fa..cc73841b78 100644 --- a/lib/Analysis/CFRefCount.cpp +++ b/lib/Analysis/CFRefCount.cpp @@ -1149,7 +1149,11 @@ RetainSummary* RetainSummaryManager::getSummary(FunctionDecl* FD) { // [PR 3337] Use 'getAs' to strip away any typedefs on the // function's type. const FunctionType* FT = FD->getType()->getAs(); - const char* FName = FD->getIdentifier()->getNameStart(); + const IdentifierInfo *II = FD->getIdentifier(); + if (!II) + break; + + const char* FName = II->getNameStart(); // Strip away preceding '_'. Doing this here will effect all the checks // down below.