File tree Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Expand file tree Collapse file tree 2 files changed +6
-12
lines changed Original file line number Diff line number Diff line change @@ -68,6 +68,9 @@ OBJC_EXPORT Class objc_readClassPair(Class cls,
68
68
const struct objc_image_info *info)
69
69
__OSX_AVAILABLE_STARTING(__MAC_10_10, __IPHONE_8_0);
70
70
71
+ // Magic symbol whose _address_ is the runtime's isa mask.
72
+ OBJC_EXPORT const struct { char c; } objc_absolute_packed_isa_class_mask;
73
+
71
74
72
75
namespace swift {
73
76
Original file line number Diff line number Diff line change @@ -198,18 +198,9 @@ static id _getClassDescription(Class cls) {
198
198
199
199
@implementation SwiftObject
200
200
+ (void )initialize {
201
- #if SWIFT_HAS_ISA_MASKING && !NDEBUG
202
- // Older OSes may not have this variable, or it may not match. This code only
203
- // runs on older OSes in certain testing scenarios, so that doesn't matter.
204
- // Only perform the check on newer OSes where the value should definitely
205
- // match.
206
- # if SWIFT_BUILD_HAS_BACK_DEPLOYMENT
207
- if (!_swift_isBackDeploying ())
208
- # endif
209
- {
210
- assert (&objc_debug_isa_class_mask);
211
- assert (objc_debug_isa_class_mask == SWIFT_ISA_MASK);
212
- }
201
+ #if SWIFT_HAS_ISA_MASKING && !TARGET_OS_SIMULATOR && !NDEBUG
202
+ assert (&objc_absolute_packed_isa_class_mask);
203
+ assert ((uintptr_t )&objc_absolute_packed_isa_class_mask == SWIFT_ISA_MASK);
213
204
#endif
214
205
}
215
206
You can’t perform that action at this time.
0 commit comments