Check if an IdentifierInfo* is null when the FunctionDecl isn't a simple C function.

Fixes <rdar://problem/12355298>

llvm-svn: 164988
This commit is contained in:
Ted Kremenek 2012-10-02 04:36:54 +00:00
parent 01f63b950c
commit b67c6cc24d
1 changed files with 6 additions and 2 deletions

View File

@ -5510,8 +5510,12 @@ static Expr *findCapturingExpr(Sema &S, Expr *e, RetainCycleOwner &owner) {
} else if (CallExpr *CE = dyn_cast<CallExpr>(e)) {
if (CE->getNumArgs() == 1) {
FunctionDecl *Fn = dyn_cast_or_null<FunctionDecl>(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();
}
}
}
}