From: Ted Kremenek Date: Tue, 2 Oct 2012 04:36:54 +0000 (+0000) Subject: Check if an IdentifierInfo* is null when the FunctionDecl isn't a simple C function. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d13eff6f77216a6fb25e18f600b492db4f0492e8;p=clang Check if an IdentifierInfo* is null when the FunctionDecl isn't a simple C function. Fixes git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164988 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/Sema/SemaChecking.cpp b/lib/Sema/SemaChecking.cpp index 7498d34892..81be8bfe8f 100644 --- a/lib/Sema/SemaChecking.cpp +++ b/lib/Sema/SemaChecking.cpp @@ -5510,8 +5510,12 @@ static Expr *findCapturingExpr(Sema &S, Expr *e, RetainCycleOwner &owner) { } else if (CallExpr *CE = dyn_cast(e)) { if (CE->getNumArgs() == 1) { FunctionDecl *Fn = dyn_cast_or_null(CE->getCalleeDecl()); - if (Fn && Fn->getIdentifier()->isStr("_Block_copy")) - e = CE->getArg(0)->IgnoreParenCasts(); + if (Fn) { + const IdentifierInfo *FnI = Fn->getIdentifier(); + if (FnI && FnI->isStr("_Block_copy")) { + e = CE->getArg(0)->IgnoreParenCasts(); + } + } } }