From: Ted Kremenek Date: Mon, 2 Apr 2012 21:55:06 +0000 (+0000) Subject: Fix potential null dereference in the static analyzer when inlining a call that has... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9b795524eb3dc035523f82f135d0a8adf15cd72;p=clang Fix potential null dereference in the static analyzer when inlining a call that has already been inlined. Unfortunately I have no test case. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@153900 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp index 0440ca953a..272f13eb6b 100644 --- a/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp +++ b/lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp @@ -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; } }