Skip to content

Commit 58cf726

Browse files
committed
IRGen: Fix OpaqueStorageTypeInfo lowering
Can't call claimAll, rather need to call claimNext() according to the number of expected explosions. rdar://86069782
1 parent 2f8e132 commit 58cf726

File tree

2 files changed

+16
-2
lines changed

2 files changed

+16
-2
lines changed

lib/IRGen/GenType.cpp

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1199,11 +1199,17 @@ namespace {
11991199

12001200
void consume(IRGenFunction &IGF, Explosion &explosion,
12011201
Atomicity atomicity) const override {
1202-
(void)explosion.claimAll();
1202+
for (auto scalarTy: ScalarTypes) {
1203+
(void)scalarTy;
1204+
(void)explosion.claimNext();
1205+
}
12031206
}
12041207

12051208
void fixLifetime(IRGenFunction &IGF, Explosion &explosion) const override {
1206-
(void)explosion.claimAll();
1209+
for (auto scalarTy: ScalarTypes) {
1210+
(void)scalarTy;
1211+
(void)explosion.claimNext();
1212+
}
12071213
}
12081214

12091215
void destroy(IRGenFunction &IGF, Address address, SILType T,
Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
// RUN: %target-swift-frontend -O -emit-ir -primary-file %s -module-name A
2+
// REQUIRES: VENDOR=apple
3+
import Foundation
4+
5+
public struct Fooz {
6+
var str = ""
7+
var dec = Decimal()
8+
}

0 commit comments

Comments
 (0)