From 93354cd204acb9d1419556f496b32459dde67f90 Mon Sep 17 00:00:00 2001 From: Dario Rexin Date: Mon, 16 Jun 2025 15:16:46 -0700 Subject: [PATCH] [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. --- test/Interpreter/layout_string_witnesses_dynamic.swift | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/test/Interpreter/layout_string_witnesses_dynamic.swift b/test/Interpreter/layout_string_witnesses_dynamic.swift index 87355fe825c6f..54a789b6ab888 100644 --- a/test/Interpreter/layout_string_witnesses_dynamic.swift +++ b/test/Interpreter/layout_string_witnesses_dynamic.swift @@ -16,9 +16,6 @@ // UNSUPPORTED: use_os_stdlib // UNSUPPORTED: back_deployment_runtime -// test disabled until rdar://151476435 is fixed -// REQUIRES: rdar151476435 - import Swift import layout_string_witnesses_types import layout_string_witnesses_types_resilient @@ -33,7 +30,7 @@ class TestClass { func testGeneric() { let ptr = allocateInternalGenericPtr(of: TestClass.self) - + do { let x = TestClass() testGenericInit(ptr, to: x) @@ -1246,7 +1243,7 @@ func testNonCopyableGenericStructSimpleClass() { let ptr = UnsafeMutableBufferPointer>.allocate(capacity: 1) let x = NonCopyableGenericStruct(x: 23, y: SimpleClass(x: 23)) - ptr[0] = x + ptr.initializeElement(at: 0, to: x) // CHECK-NEXT: Before deinit print("Before deinit") @@ -1264,7 +1261,7 @@ func testNonCopyableGenericEnumSimpleClass() { let ptr = UnsafeMutableBufferPointer>.allocate(capacity: 1) let x = NonCopyableGenericEnum.x(23, SimpleClass(x: 23)) - ptr[0] = x + ptr.initializeElement(at: 0, to: x) // CHECK-NEXT: Before deinit print("Before deinit")