diff --git a/lib/SILGen/SILGenStmt.cpp b/lib/SILGen/SILGenStmt.cpp index 1babb747197f2..76be68f73ae9f 100644 --- a/lib/SILGen/SILGenStmt.cpp +++ b/lib/SILGen/SILGenStmt.cpp @@ -1253,8 +1253,8 @@ void StmtEmitter::visitForEachStmt(ForEachStmt *S) { PackType::get(SGF.getASTContext(), expansion->getType()) ->getCanonicalType()); - JumpDest loopDest = createJumpDest(S->getBody()); - JumpDest endDest = createJumpDest(S->getBody()); + JumpDest continueDest = createJumpDest(S->getBody()); + JumpDest breakDest = createJumpDest(S->getBody()); SGF.emitDynamicPackLoop( SILLocation(expansion), formalPackType, 0, @@ -1263,20 +1263,20 @@ void StmtEmitter::visitForEachStmt(ForEachStmt *S) { SILValue packIndex) { Scope innerForScope(SGF.Cleanups, CleanupLocation(S->getBody())); auto letValueInit = - SGF.emitPatternBindingInitialization(S->getPattern(), loopDest); + SGF.emitPatternBindingInitialization(S->getPattern(), continueDest); SGF.emitExprInto(expansion->getPatternExpr(), letValueInit.get()); // Set the destinations for 'break' and 'continue'. - SGF.BreakContinueDestStack.push_back({S, endDest, loopDest}); + SGF.BreakContinueDestStack.push_back({S, breakDest, continueDest}); visit(S->getBody()); SGF.BreakContinueDestStack.pop_back(); return; }, - loopDest.getBlock()); + continueDest.getBlock()); - emitOrDeleteBlock(SGF, endDest, S); + emitOrDeleteBlock(SGF, breakDest, S); return; }