[cfe-commits] r164988 - /cfe/trunk/lib/Sema/SemaChecking.cpp
Ted Kremenek
kremenek at apple.com
Mon Oct 1 21:36:54 PDT 2012
Author: kremenek
Date: Mon Oct 1 23:36:54 2012
New Revision: 164988
URL: http://llvm.org/viewvc/llvm-project?rev=164988&view=rev
Log:
Check if an IdentifierInfo* is null when the FunctionDecl isn't a simple C function.
Fixes <rdar://problem/12355298>
Modified:
cfe/trunk/lib/Sema/SemaChecking.cpp
Modified: cfe/trunk/lib/Sema/SemaChecking.cpp
URL: http://llvm.org/viewvc/llvm-project/cfe/trunk/lib/Sema/SemaChecking.cpp?rev=164988&r1=164987&r2=164988&view=diff
==============================================================================
--- cfe/trunk/lib/Sema/SemaChecking.cpp (original)
+++ cfe/trunk/lib/Sema/SemaChecking.cpp Mon Oct 1 23:36:54 2012
@@ -5510,8 +5510,12 @@
} 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();
+ }
+ }
}
}
More information about the cfe-commits
mailing list