Skip to content

Commit c276904

Browse files
authored
Merge pull request #75270 from drexin/wip-131798355
[IRGen] Fix emitPrimitiveLoadPayloadAndExtraTag for CVW
2 parents fedd5e2 + e3e06a7 commit c276904

File tree

3 files changed

+5
-5
lines changed

3 files changed

+5
-5
lines changed

lib/IRGen/GenEnum.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1696,7 +1696,7 @@ namespace {
16961696
// In CVW we have to mask the extra bits, which requires us to make
16971697
// this cast here, otherwise LLVM would optimize away the bit mask.
16981698
if (projectedBits.getElementType()->getIntegerBitWidth() < 8) {
1699-
projectedBits = IGF.Builder.CreateElementBitCast(addr, IGM.Int8Ty);
1699+
projectedBits = IGF.Builder.CreateElementBitCast(projectedBits, IGM.Int8Ty);
17001700
}
17011701
extraTag = IGF.Builder.CreateLoad(projectedBits);
17021702
auto maskBits = llvm::PowerOf2Ceil(NumExtraTagValues) - 1;

test/Interpreter/Inputs/layout_string_witnesses_types.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -620,8 +620,8 @@ public enum MultiPayloadError {
620620
}
621621

622622
public enum TwoPayloadInner {
623-
case x(AnyObject)
624-
case y(Int)
623+
case x(Int)
624+
case y(AnyObject)
625625
}
626626

627627
public enum TwoPayloadOuter {

test/Interpreter/layout_string_witnesses_static.swift

+2-2
Original file line numberDiff line numberDiff line change
@@ -1294,12 +1294,12 @@ func testNestedTwoPayload() {
12941294
let ptr = UnsafeMutablePointer<TwoPayloadOuter>.allocate(capacity: 1)
12951295

12961296
do {
1297-
let x = TwoPayloadOuter.y(TwoPayloadInner.x(SimpleClass(x: 23)))
1297+
let x = TwoPayloadOuter.y(TwoPayloadInner.y(SimpleClass(x: 23)))
12981298
testInit(ptr, to: x)
12991299
}
13001300

13011301
do {
1302-
let y = TwoPayloadOuter.y(TwoPayloadInner.x(SimpleClass(x: 1)))
1302+
let y = TwoPayloadOuter.y(TwoPayloadInner.y(SimpleClass(x: 1)))
13031303

13041304
// CHECK: Before deinit
13051305
print("Before deinit")

0 commit comments

Comments
 (0)