Skip to content

Commit ff7aeaf

Browse files
authored
Merge pull request #26520 from jckarter/switch-loadable-after-address-only
SILGen: Emit bb args for shared loadable case bindings that come after address-only ones.
2 parents 5991156 + 7adfc52 commit ff7aeaf

File tree

2 files changed

+14
-1
lines changed

2 files changed

+14
-1
lines changed

lib/SILGen/SILGenPattern.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2341,7 +2341,7 @@ void PatternMatchEmission::initSharedCaseBlockDest(CaseStmt *caseBlock,
23412341
// We don't pass address-only values in basic block arguments.
23422342
SILType ty = SGF.getLoweredType(vd->getType());
23432343
if (ty.isAddressOnly(SGF.F))
2344-
return;
2344+
continue;
23452345
block->createPhiArgument(ty, ValueOwnershipKind::Owned, vd);
23462346
}
23472347
}
Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
// RUN: %target-swift-emit-silgen %s
2+
3+
// rdar://problem/53956564
4+
5+
func foo<T>(x: Int, y: T, z: Int) {
6+
switch (x, y, z) {
7+
case (let xx, let yy, let zz), (let xx, let yy, let zz):
8+
_ = xx
9+
_ = yy
10+
_ = zz
11+
break
12+
}
13+
}

0 commit comments

Comments
 (0)