File tree Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Expand file tree Collapse file tree 1 file changed +9
-5
lines changed Original file line number Diff line number Diff line change @@ -195,11 +195,15 @@ Class _swift_classOfObjCHeapObject(OpaqueValue *value) {
195
195
196
196
@implementation SwiftObject
197
197
+ (void )initialize {
198
- #if SWIFT_HAS_ISA_MASKING
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);
198
+ #if SWIFT_HAS_ISA_MASKING && !NDEBUG
199
+ // Older OSes may not have this variable, or it may not match. This code only
200
+ // runs on older OSes in certain testing scenarios, so that doesn't matter.
201
+ // Only perform the check on newer OSes where the value should definitely
202
+ // match.
203
+ if (!_swift_isBackDeploying ()) {
204
+ assert (&objc_debug_isa_class_mask);
205
+ assert (objc_debug_isa_class_mask == SWIFT_ISA_MASK);
206
+ }
203
207
#endif
204
208
}
205
209
You can’t perform that action at this time.
0 commit comments