Skip to content

Commit bfef818

Browse files
authored
Merge pull request swiftlang#37753 from atrick/adjust-poison-sentinel
Use a decent sentinel value for reference poison
2 parents daa8aac + 07f65f3 commit bfef818

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

stdlib/public/SwiftShims/System.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@
7676
// This is not ABI per-se but does stay in-sync with LLDB. If it becomes
7777
// out-of-sync, then users won't see a friendly diagnostic when inspecting
7878
// references past their lifetime.
79-
#define SWIFT_ABI_DEFAULT_REFERENCE_POISON_DEBUG_VALUE_32 0x00000880U
80-
#define SWIFT_ABI_DEFAULT_REFERENCE_POISON_DEBUG_VALUE_64 0x0000000000000880ULL
79+
#define SWIFT_ABI_DEFAULT_REFERENCE_POISON_DEBUG_VALUE_32 0x00000440U
80+
#define SWIFT_ABI_DEFAULT_REFERENCE_POISON_DEBUG_VALUE_64 0x0000000000000440ULL
8181

8282
/*********************************** i386 *************************************/
8383

test/IRGen/debug_poison.swift

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ private func useOptionalK(_: K?) -> Int {
3737
// CHECK: store %T12debug_poison1KC* [[REF]], %T12debug_poison1KC** %b.debug
3838
// CHECK: [[Y:%.*]] = call {{.*}} [[INT]] @"$s12debug_poison4use{{.*}}"(%T12debug_poison1KC* [[REF]])
3939
// CHECK: call void {{.*}} @swift_release {{.*}} [[REF]]
40-
// CHECK: store %T12debug_poison1KC* inttoptr ([[INT]] 2176 to %T12debug_poison1KC*), %T12debug_poison1KC** %b.debug
40+
// CHECK: store %T12debug_poison1KC* inttoptr ([[INT]] 1088 to %T12debug_poison1KC*), %T12debug_poison1KC** %b.debug
4141
// CHECK: store [[INT]] [[Y]], [[INT]]* %y.debug
4242
// CHECK: call {{.*}} void @"$s12debug_poison6useIntyySiF"([[INT]] [[Y]])
4343
public func testPoisonRef() {
@@ -56,7 +56,7 @@ public func testPoisonRef() {
5656
// CHECK: [[Y:%.*]] = call {{.*}} [[INT]] @"$s12debug_poison12useOptionalK{{.*}}"([[INT]] [[REF]])
5757
// CHECK: call void @swift_release
5858
// CHECK: [[NIL:%.*]] = icmp eq [[INT]] [[REF]], 0
59-
// CHECK: [[POISON:%.*]] = select i1 [[NIL]], [[INT]] [[REF]], [[INT]] 2176
59+
// CHECK: [[POISON:%.*]] = select i1 [[NIL]], [[INT]] [[REF]], [[INT]] 1088
6060
// CHECK: store [[INT]] [[POISON]], [[INT]]* %b.debug
6161
// CHECK: store [[INT]] [[Y]], [[INT]]* %y.debug
6262
// CHECK: call {{.*}} void @"$s12debug_poison6useIntyySiF"([[INT]] [[Y]])
@@ -80,7 +80,7 @@ public func testPoisonOptionalRef() {
8080
// CHECK: call {{.*}} void @"$s12debug_poison6useAnyyyypF"(
8181
// CHECK: call void @swift_{{unknownObjectRelease|release}}(%[[REFTY]]* [[REF]]) #1
8282
// CHECK: [[GEP1:%.*]] = getelementptr inbounds %T12debug_poison1PP, %T12debug_poison1PP* %b.debug, i32 0, i32 0
83-
// CHECK: store %[[REFTY]]* inttoptr ([[INT]] 2176 to %[[REFTY]]*), %[[REFTY]]** [[GEP1]]
83+
// CHECK: store %[[REFTY]]* inttoptr ([[INT]] 1088 to %[[REFTY]]*), %[[REFTY]]** [[GEP1]]
8484
// CHECK: call {{.*}} void @"$s12debug_poison7useNoneyyF"()
8585
public func testPoisonExistential() {
8686
let b: P = D()
@@ -102,7 +102,7 @@ public func testPoisonExistential() {
102102
// CHECK: call {{.*}} void @"$s12debug_poison6useAnyyyypF"(
103103
// CHECK: call void @swift_{{unknownObjectRelease|release}}(%[[REFTY]]* [[REF]]) #1
104104
// CHECK: [[GEP1:%.*]] = getelementptr inbounds %T12debug_poison1Q_Xl, %T12debug_poison1Q_Xl* %b.debug, i32 0, i32 0
105-
// CHECK: store %[[REFTY]]* inttoptr ([[INT]] 2176 to %[[REFTY]]*), %[[REFTY]]** [[GEP1]]
105+
// CHECK: store %[[REFTY]]* inttoptr ([[INT]] 1088 to %[[REFTY]]*), %[[REFTY]]** [[GEP1]]
106106
// CHECK: call {{.*}} void @"$s12debug_poison7useNoneyyF"()
107107
public func testPoisonComposite() {
108108
let b: Q & AnyObject = E()

0 commit comments

Comments
 (0)