From: Ted Kremenek Date: Wed, 27 Feb 2008 17:33:02 +0000 (+0000) Subject: Fixed edge-case in CFG construction where goto jumps would not always get X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=0d99ecf1d8b9c72f2c4130f5f1be6cf13556b031;p=clang Fixed edge-case in CFG construction where goto jumps would not always get properly back-patched. git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@47675 91177308-0d34-0410-b5e6-96231b3b80d8 --- diff --git a/AST/CFG.cpp b/AST/CFG.cpp index 3ea5313619..ed9b320023 100644 --- a/AST/CFG.cpp +++ b/AST/CFG.cpp @@ -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);