From: Ted Kremenek Date: Thu, 13 Nov 2008 06:36:45 +0000 (+0000) Subject: Correctly connect 'continue' and 'break' statements in Objective-C fast enumeration... X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=fc335523052a55f21750c4b111f1c8d85b418e5a;p=clang 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 --- 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 save_continue(ContinueTargetBlock), + save_break(BreakTargetBlock); + + BreakTargetBlock = LoopSuccessor; + ContinueTargetBlock = ConditionBlock; Succ = ConditionBlock; + CFGBlock* BodyBlock = Visit(S->getBody()); FinishBlock(BodyBlock);