Skip to content

Commit 3ec3d9b

Browse files
committed
[Runtime] In the assert for SWIFT_ISA_MASK, tolerate it if objc_debug_isa_class_mask is not available.
rdar://problem/50674635
1 parent 14a20ee commit 3ec3d9b

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

stdlib/public/runtime/SwiftObject.mm

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -196,8 +196,10 @@ Class _swift_classOfObjCHeapObject(OpaqueValue *value) {
196196
@implementation SwiftObject
197197
+ (void)initialize {
198198
#if SWIFT_HAS_ISA_MASKING
199-
assert(&objc_debug_isa_class_mask);
200-
assert(objc_debug_isa_class_mask == SWIFT_ISA_MASK);
199+
// Really old ObjC runtimes don't have this symbol, which is OK. If
200+
// the symbol exists, then our value must match.
201+
assert(&objc_debug_isa_class_mask == NULL ||
202+
objc_debug_isa_class_mask == SWIFT_ISA_MASK);
201203
#endif
202204
}
203205

0 commit comments

Comments
 (0)