]> granicus.if.org Git - clang/commitdiff
[analyzer] Fix a buildbot crash triggered by turning on dynamic
authorAnna Zaks <ganna@apple.com>
Tue, 25 Sep 2012 00:31:43 +0000 (00:31 +0000)
committerAnna Zaks <ganna@apple.com>
Tue, 25 Sep 2012 00:31:43 +0000 (00:31 +0000)
dispatch.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@164579 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Checkers/BasicObjCFoundationChecks.cpp

index 1078cd363408fe3ba552f1776f9adfbd4ad6d470..48dd41593c71baa1761eb536c9792174f28a11c7 100644 (file)
@@ -763,7 +763,7 @@ void ObjCNonNilReturnValueChecker::checkPostObjCMessage(const ObjCMethodCall &M,
     // since 'nil' is rarely returned in practice, we should not warn when the
     // caller to the defensive constructor uses the object in contexts where
     // 'nil' is not accepted.
-    if (C.isWithinInlined() &&
+    if (C.isWithinInlined() && M.getDecl() &&
         M.getDecl()->getMethodFamily() == OMF_init &&
         M.isReceiverSelfOrSuper()) {
       State = assumeExprIsNonNull(M.getOriginExpr(), State, C);