Skip to content

Commit 3e027b7

Browse files
committed
[Runtime] Set fastDeallocSupported to false on i386 simulators.
The conditional should have been "Intel simulators" but it was actually "x86-64 simulators." The i386 simulator doesn't have the weak formation callout, which causes it to miss cleaning up associated objects when the Swift runtime thinks it does. rdar://79672466
1 parent d3d87e8 commit 3e027b7

File tree

3 files changed

+3
-9
lines changed

3 files changed

+3
-9
lines changed

stdlib/public/runtime/HeapObject.cpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -700,10 +700,10 @@ void swift::swift_deallocClassInstance(HeapObject *object,
700700
#if SWIFT_OBJC_INTEROP
701701
// We need to let the ObjC runtime clean up any associated objects or weak
702702
// references associated with this object.
703-
#if !TARGET_OS_SIMULATOR || !__x86_64__
704-
const bool fastDeallocSupported = true;
705-
#else
703+
#if TARGET_OS_SIMULATOR && (__x86_64__ || __i386__)
706704
const bool fastDeallocSupported = false;
705+
#else
706+
const bool fastDeallocSupported = true;
707707
#endif
708708
if (!fastDeallocSupported || !object->refCounts.getPureSwiftDeallocation()) {
709709
objc_destructInstance((id)object);

test/Interpreter/SDK/objc_bridge_cast.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
// REQUIRES: objc_interop
55

6-
// rdar://79672466 - This test fails on watchsimulator-i386
7-
// UNSUPPORTED: OS=watchos && CPU=i386
8-
96
// Test dynamic casts that bridge value types through the runtime.
107

118
import Foundation

test/Interpreter/SDK/objc_dealloc.swift

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,6 @@
33

44
// REQUIRES: objc_interop
55

6-
// rdar://79672466 - This test fails for watchsimulator-i386
7-
// UNSUPPORTED: OS=watchos && CPU=i386
8-
96
import Foundation
107

118
// Check that ObjC associated objects are cleaned up when attached to native

0 commit comments

Comments
 (0)