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

lib/StaticAnalyzer/Core/LoopUnrolling.cpp

index c44122e1872be31ca798784eb9aeb4a56dbbbdc6..dd37cbd21840c637e7b6122a49775ebca37c2bdd 100644 (file)
@@ -183,9 +183,9 @@ 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 (BlockSet.find(SearchedBlock) == BlockSet.end() && !StackFrame->inTopFrame()) {
+    while (BlockSet.find(SearchedBlock) == BlockSet.end() && StackFrame) {
       SearchedBlock = StackFrame->getCallSiteBlock();
-      if(!SearchedBlock)
+      if(!SearchedBlock || StackFrame->inTopFrame())
         break;
       StackFrame = StackFrame->getParent()->getCurrentStackFrame();
     }