aboutsummaryrefslogtreecommitdiff
path: root/lib/AST/CFG.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'lib/AST/CFG.cpp')
-rw-r--r--lib/AST/CFG.cpp15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/AST/CFG.cpp b/lib/AST/CFG.cpp
index 4ec124fe02..14c93f398e 100644
--- a/lib/AST/CFG.cpp
+++ b/lib/AST/CFG.cpp
@@ -1086,8 +1086,11 @@ CFGBlock* CFGBuilder::VisitContinueStmt(ContinueStmt* C) {
Block->setTerminator(C);
// If there is no target for the continue, then we are looking at an
- // incomplete AST. Handle this by not registering a successor.
- if (ContinueTargetBlock) Block->addSuccessor(ContinueTargetBlock);
+ // incomplete AST. This means the CFG cannot be constructed.
+ if (ContinueTargetBlock)
+ Block->addSuccessor(ContinueTargetBlock);
+ else
+ badCFG = true;
return Block;
}
@@ -1102,8 +1105,12 @@ CFGBlock* CFGBuilder::VisitBreakStmt(BreakStmt* B) {
Block->setTerminator(B);
// If there is no target for the break, then we are looking at an
- // incomplete AST. Handle this by not registering a successor.
- if (BreakTargetBlock) Block->addSuccessor(BreakTargetBlock);
+ // incomplete AST. This means that the CFG cannot be constructed.
+ if (BreakTargetBlock)
+ Block->addSuccessor(BreakTargetBlock);
+ else
+ badCFG = true;
+
return Block;
}