]> granicus.if.org Git - clang/commitdiff
Fix potential null dereference in the static analyzer when inlining a call that has...
authorTed Kremenek <kremenek@apple.com>
Mon, 2 Apr 2012 21:55:06 +0000 (21:55 +0000)
committerTed Kremenek <kremenek@apple.com>
Mon, 2 Apr 2012 21:55:06 +0000 (21:55 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153900 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp

index 0440ca953a76e8eadf0a6f639fff30cfe6445fca..272f13eb6b06dbd583d55a786d3e9085ac03f202 100644 (file)
@@ -202,10 +202,11 @@ bool ExprEngine::InlineCall(ExplodedNodeSet &Dst,
       
       CallEnter Loc(CE, CalleeSFC, Pred->getLocationContext());
       bool isNew;
-      ExplodedNode *N = G.getNode(Loc, state, false, &isNew);
-      N->addPredecessor(Pred, G);
-      if (isNew)
-        Engine.getWorkList()->enqueue(N);
+      if (ExplodedNode *N = G.getNode(Loc, state, false, &isNew)) {
+        N->addPredecessor(Pred, G);
+        if (isNew)
+          Engine.getWorkList()->enqueue(N);
+      }
       return true;
     }
   }