diff options
author | Ted Kremenek <kremenek@apple.com> | 2008-11-13 06:36:45 +0000 |
---|---|---|
committer | Ted Kremenek <kremenek@apple.com> | 2008-11-13 06:36:45 +0000 |
commit | fc335523052a55f21750c4b111f1c8d85b418e5a (patch) | |
tree | dfe16c2df33faa1516a6d1a53fe8e640b685660c | |
parent | 062e2f9a0ecccfdb6c8be8d797b66abca8dfbfbc (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.cpp | 7 |
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); |