From: Peter Szecsi Date: Tue, 25 Jul 2017 21:54:58 +0000 (+0000) Subject: [StaticAnalyzer] LoopUnrolling - Attempt to fix a crash in r309006. X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=7acd9fa108594ae75f3efdf4722d3ca4e6d16332;p=clang [StaticAnalyzer] LoopUnrolling - Attempt to fix a crash in r309006. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309036 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/lib/StaticAnalyzer/Core/LoopUnrolling.cpp b/lib/StaticAnalyzer/Core/LoopUnrolling.cpp index a88e0622f1..c44122e187 100644 --- a/lib/StaticAnalyzer/Core/LoopUnrolling.cpp +++ b/lib/StaticAnalyzer/Core/LoopUnrolling.cpp @@ -183,8 +183,10 @@ bool isUnrolledLoopBlock(const CFGBlock *Block, ExplodedNode *Pred, LBV.setBlocksOfLoop(E.first, M); // In case of an inlined function call check if any of its callSiteBlock is // marked. - while (SearchedBlock && BlockSet.find(SearchedBlock) == BlockSet.end()) { + while (BlockSet.find(SearchedBlock) == BlockSet.end() && !StackFrame->inTopFrame()) { SearchedBlock = StackFrame->getCallSiteBlock(); + if(!SearchedBlock) + break; StackFrame = StackFrame->getParent()->getCurrentStackFrame(); } delete M;