Correctly connect 'continue' and 'break' statements in Objective-C fast enumeration for blocks to the appropriate basic blocks.

llvm-svn: 59226
This commit is contained in:
Ted Kremenek 2008-11-13 06:36:45 +00:00
parent 16866d6fd8
commit 1516dc075a
1 changed files with 7 additions and 0 deletions

View File

@ -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);