Skip to content

Commit d5cdea7

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

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
@@ -1322,6 +1322,10 @@ bool SILInstruction::mayRequirePackMetadata() const {
13221322
{
13231323
return getOperand(0)->getType().hasPack();
13241324
}
1325+
case SILInstructionKind::AllocStackInst: {
1326+
auto *asi = cast<AllocStackInst>(this);
1327+
return asi->getType().hasPack();
1328+
}
13251329
case SILInstructionKind::MetatypeInst: {
13261330
auto *mi = cast<MetatypeInst>(this);
13271331
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)