]> granicus.if.org Git - clang/commitdiff
[StaticAnalyzer] LoopUnrolling - Attempt to fix a crash in r309006.
authorPeter Szecsi <szepet95@gmail.com>
Tue, 25 Jul 2017 21:54:58 +0000 (21:54 +0000)
committerPeter Szecsi <szepet95@gmail.com>
Tue, 25 Jul 2017 21:54:58 +0000 (21:54 +0000)
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@309036 91177308-0d34-0410-b5e6-96231b3b80d8

lib/StaticAnalyzer/Core/LoopUnrolling.cpp

index a88e0622f11fa3582094f2f22ab91c222322ffcd..c44122e1872be31ca798784eb9aeb4a56dbbbdc6 100644 (file)
@@ -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;