Skip to content

Commit f001896

Browse files
committed
[Tests] Fix Interpreter/layout_string_witnesses_objc.swift
rdar://138141889 The allocation and destruction was accidentally using a wrapper, but the initialization did not, so this test could crash if the uninitialized memory contained a valid address.
1 parent db4aa81 commit f001896

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

test/Interpreter/layout_string_witnesses_objc.swift

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ struct MultiPayloadObjCExistentialWrapper {
6464
}
6565

6666
func testMultiPayloadObjCExistentialWrapper() {
67-
let ptr = allocateInternalGenericPtr(of: NestedWrapper<MultiPayloadObjCExistentialWrapper>.self)
67+
let ptr = allocateInternalGenericPtr(of: MultiPayloadObjCExistentialWrapper.self)
6868

6969
do {
7070
let x = MultiPayloadObjCExistentialWrapper(x: .y(ObjCPrintOnDealloc()))
@@ -84,7 +84,7 @@ func testMultiPayloadObjCExistentialWrapper() {
8484
print("Before deinit")
8585

8686
// CHECK-NEXT: ObjCPrintOnDealloc deinitialized!
87-
testGenericDestroy(ptr, of: NestedWrapper<MultiPayloadObjCExistentialWrapper>.self)
87+
testGenericDestroy(ptr, of: MultiPayloadObjCExistentialWrapper.self)
8888

8989
ptr.deallocate()
9090
}

0 commit comments

Comments
 (0)