Skip to content

Commit 6158156

Browse files
committed
[Test] Fix Interpreter/layout_string_witnesses_dynamic.swift
rdar://151476435 Two tests incorrectly assigned values to an uninitialized pointer instead of initializing it. This caused crashes on some distros.
1 parent 083cb11 commit 6158156

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

test/Interpreter/layout_string_witnesses_dynamic.swift

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,9 +16,6 @@
1616
// UNSUPPORTED: use_os_stdlib
1717
// UNSUPPORTED: back_deployment_runtime
1818

19-
// test disabled until rdar://151476435 is fixed
20-
// REQUIRES: rdar151476435
21-
2219
import Swift
2320
import layout_string_witnesses_types
2421
import layout_string_witnesses_types_resilient
@@ -33,7 +30,7 @@ class TestClass {
3330

3431
func testGeneric() {
3532
let ptr = allocateInternalGenericPtr(of: TestClass.self)
36-
33+
3734
do {
3835
let x = TestClass()
3936
testGenericInit(ptr, to: x)
@@ -1246,7 +1243,7 @@ func testNonCopyableGenericStructSimpleClass() {
12461243
let ptr = UnsafeMutableBufferPointer<NonCopyableGenericStruct<SimpleClass>>.allocate(capacity: 1)
12471244

12481245
let x = NonCopyableGenericStruct(x: 23, y: SimpleClass(x: 23))
1249-
ptr[0] = x
1246+
ptr.initializeElement(at: 0, to: x)
12501247

12511248
// CHECK-NEXT: Before deinit
12521249
print("Before deinit")
@@ -1264,7 +1261,7 @@ func testNonCopyableGenericEnumSimpleClass() {
12641261
let ptr = UnsafeMutableBufferPointer<NonCopyableGenericEnum<SimpleClass>>.allocate(capacity: 1)
12651262

12661263
let x = NonCopyableGenericEnum.x(23, SimpleClass(x: 23))
1267-
ptr[0] = x
1264+
ptr.initializeElement(at: 0, to: x)
12681265

12691266
// CHECK-NEXT: Before deinit
12701267
print("Before deinit")

0 commit comments

Comments
 (0)