From d9b795524eb3dc035523f82f135d0a8adf15cd72 Mon Sep 17 00:00:00 2001 From: Ted Kremenek Date: Mon, 2 Apr 2012 21:55:06 +0000 Subject: [PATCH] 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 --- lib/StaticAnalyzer/Core/ExprEngineCallAndReturn.cpp | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) 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; } } -- 2.50.1