SILGen: Emit bb args for shared loadable case bindings that come after address-only ones.

Looks like a think-o; even if we see an address-only binding in a shared pattern block, we still
expect bb args in the lowered basic block for anything that comes after it. rdar://problem/53956564
This commit is contained in:
Joe Groff
2019-08-06 15:09:01 -07:00
parent b7119ee742
commit 7adfc52447
2 changed files with 14 additions and 1 deletions

View File

@@ -2341,7 +2341,7 @@ void PatternMatchEmission::initSharedCaseBlockDest(CaseStmt *caseBlock,
// We don't pass address-only values in basic block arguments.
SILType ty = SGF.getLoweredType(vd->getType());
if (ty.isAddressOnly(SGF.F))
return;
continue;
block->createPhiArgument(ty, ValueOwnershipKind::Owned, vd);
}
}

View File

@@ -0,0 +1,13 @@
// RUN: %target-swift-emit-silgen %s
// rdar://problem/53956564
func foo<T>(x: Int, y: T, z: Int) {
switch (x, y, z) {
case (let xx, let yy, let zz), (let xx, let yy, let zz):
_ = xx
_ = yy
_ = zz
break
}
}