]> granicus.if.org Git - clang/commitdiff
Fixed edge-case in CFG construction where goto jumps would not always get
authorTed Kremenek <kremenek@apple.com>
Wed, 27 Feb 2008 17:33:02 +0000 (17:33 +0000)
committerTed Kremenek <kremenek@apple.com>
Wed, 27 Feb 2008 17:33:02 +0000 (17:33 +0000)
properly back-patched.

git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47675 91177308-0d34-0410-b5e6-96231b3b80d8

AST/CFG.cpp

index 3ea531361947bb9988f6785b8e0de4f781149607..ed9b320023d4521743ed85be8eff42b8b0c7dc38 100644 (file)
@@ -142,7 +142,10 @@ CFG* CFGBuilder::buildCFG(Stmt* Statement) {
   Block = NULL;  // the EXIT block is empty.  Create all other blocks lazily.
   
   // Visit the statements and create the CFG.
-  if (CFGBlock* B = Visit(Statement)) {
+  CFGBlock* B = Visit(Statement);
+  if (!B) B = Succ;
+  
+  if (B) {
     // Finalize the last constructed block.  This usually involves
     // reversing the order of the statements in the block.
     if (Block) FinishBlock(B);