summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2012-10-02 04:36:54 +0000
committerTed Kremenek <kremenek@apple.com>2012-10-02 04:36:54 +0000
commitb67c6cc24de76e0d74f932f3534a76f6f939d8a2 (patch)
treea00088fcbf37370802d79799bb6811713263cc01
parent01f63b950c042d659349961470d9e9956cfd75da (diff)
downloadbcm5719-llvm-b67c6cc24de76e0d74f932f3534a76f6f939d8a2.tar.gz
bcm5719-llvm-b67c6cc24de76e0d74f932f3534a76f6f939d8a2.zip
Check if an IdentifierInfo* is null when the FunctionDecl isn't a simple C function.
Fixes <rdar://problem/12355298> llvm-svn: 164988
-rw-r--r--clang/lib/Sema/SemaChecking.cpp8
1 files changed, 6 insertions, 2 deletions
diff --git a/clang/lib/Sema/SemaChecking.cpp b/clang/lib/Sema/SemaChecking.cpp
index 7498d348920..81be8bfe8f3 100644
--- a/clang/lib/Sema/SemaChecking.cpp
+++ b/clang/lib/Sema/SemaChecking.cpp
@@ -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();
+ }
+ }
}
}
OpenPOWER on IntegriCloud