Skip to content

Commit ad2223d

Browse files
committed
[IRGen] alloc_stack may allocate pack metadata.
When it's a tuple containing a pack.
1 parent b3cd553 commit ad2223d

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

lib/SIL/IR/SILInstruction.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1304,6 +1304,10 @@ bool SILInstruction::mayRequirePackMetadata() const {
13041304
{
13051305
return getOperand(0)->getType().hasPack();
13061306
}
1307+
case SILInstructionKind::AllocStackInst: {
1308+
auto *asi = cast<AllocStackInst>(this);
1309+
return asi->getType().hasPack();
1310+
}
13071311
case SILInstructionKind::MetatypeInst: {
13081312
auto *mi = cast<MetatypeInst>(this);
13091313
return mi->getType().hasPack();
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
// RUN: %target-swift-frontend -emit-ir %s
2+
3+
// Verify that we don't hit the `Instruction missing on-stack pack metadata cleanups!` assertion.
4+
5+
// For alloc_stacks of tuples featuring a pack.
6+
public func tupleExpansionWithMemberType<each T: Sequence>(seqs: (repeat each T), elts: (repeat (each T).Element)) {}

0 commit comments

Comments
 (0)