diff options
| author | Ted Kremenek <kremenek@apple.com> | 2012-10-02 04:36:54 +0000 |
|---|---|---|
| committer | Ted Kremenek <kremenek@apple.com> | 2012-10-02 04:36:54 +0000 |
| commit | b67c6cc24de76e0d74f932f3534a76f6f939d8a2 (patch) | |
| tree | a00088fcbf37370802d79799bb6811713263cc01 /clang/lib | |
| parent | 01f63b950c042d659349961470d9e9956cfd75da (diff) | |
| download | bcm5719-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
Diffstat (limited to 'clang/lib')
| -rw-r--r-- | clang/lib/Sema/SemaChecking.cpp | 8 |
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(); + } + } } } |

