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 3ea5313..ed9b320 100644
--- a/AST/CFG.cpp
+++ b/AST/CFG.cpp
@@ -142,7 +142,10 @@
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);