mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
SILGen: Fix break/continue inside 'for ... in ... repeat' loop
We were creating the JumpDests too early, so lowering a 'break' or 'continue' statement would perform cleanups that were recorded while evaluating the pack expansion expression, which would cause SIL verifier errors and runtime crashes. - Fixes https://github.com/swiftlang/swift/issues/78598 - Fixes rdar://131847933
This commit is contained in:
@@ -597,9 +597,11 @@ public:
|
||||
{&substEltType});
|
||||
|
||||
SGF.emitDynamicPackLoop(loc, inducedPackType, packComponentIndex,
|
||||
openedEnv, [&](SILValue indexWithinComponent,
|
||||
SILValue expansionPackIndex,
|
||||
SILValue packIndex) {
|
||||
openedEnv,
|
||||
[]() -> SILBasicBlock * { return nullptr; },
|
||||
[&](SILValue indexWithinComponent,
|
||||
SILValue expansionPackIndex,
|
||||
SILValue packIndex) {
|
||||
componentInit->performPackExpansionInitialization(SGF, loc,
|
||||
indexWithinComponent,
|
||||
[&](Initialization *eltInit) {
|
||||
|
||||
Reference in New Issue
Block a user