aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTed Kremenek <kremenek@apple.com>2008-11-13 06:36:45 +0000
committerTed Kremenek <kremenek@apple.com>2008-11-13 06:36:45 +0000
commitfc335523052a55f21750c4b111f1c8d85b418e5a (patch)
treedfe16c2df33faa1516a6d1a53fe8e640b685660c
parent062e2f9a0ecccfdb6c8be8d797b66abca8dfbfbc (diff)
Correctly connect 'continue' and 'break' statements in Objective-C fast enumeration for blocks to the appropriate basic blocks.
git-svn-id: https://llvm.org/svn/llvm-project/cfe/trunk@59226 91177308-0d34-0410-b5e6-96231b3b80d8
-rw-r--r--lib/AST/CFG.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/lib/AST/CFG.cpp b/lib/AST/CFG.cpp
index 35eaa14332..fd3741291e 100644
--- a/lib/AST/CFG.cpp
+++ b/lib/AST/CFG.cpp
@@ -839,7 +839,14 @@ CFGBlock* CFGBuilder::VisitObjCForCollectionStmt(ObjCForCollectionStmt* S) {
ConditionBlock->setTerminator(S); // No need to call FinishBlock; 1 stmt
// Now create the true branch.
+ // Save the current values for the continue and break targets
+ SaveAndRestore<CFGBlock*> save_continue(ContinueTargetBlock),
+ save_break(BreakTargetBlock);
+
+ BreakTargetBlock = LoopSuccessor;
+ ContinueTargetBlock = ConditionBlock;
Succ = ConditionBlock;
+
CFGBlock* BodyBlock = Visit(S->getBody());
FinishBlock(BodyBlock);