File tree Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Expand file tree Collapse file tree 2 files changed +14
-3
lines changed Original file line number Diff line number Diff line change @@ -103,9 +103,11 @@ class TypeInfo {
103
103
// value here.
104
104
# define SWIFT_ISA_MASK 0xfffffffffffffff8ULL
105
105
# elif __arm64__
106
+ // The ISA mask used when ptrauth is available.
107
+ # define SWIFT_ISA_MASK_PTRAUTH 0x007ffffffffffff8ULL
106
108
// ARM64 simulators always use the ARM64e mask.
107
109
# if __has_feature(ptrauth_calls) || TARGET_OS_SIMULATOR
108
- # define SWIFT_ISA_MASK 0x007ffffffffffff8ULL
110
+ # define SWIFT_ISA_MASK SWIFT_ISA_MASK_PTRAUTH
109
111
# else
110
112
# if TARGET_OS_OSX
111
113
# define SWIFT_ISA_MASK 0x00007ffffffffff8ULL
Original file line number Diff line number Diff line change @@ -199,8 +199,17 @@ static id _getClassDescription(Class cls) {
199
199
@implementation SwiftObject
200
200
+ (void )initialize {
201
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);
202
+ uintptr_t libObjCMask = (uintptr_t )&objc_absolute_packed_isa_class_mask;
203
+ assert (libObjCMask);
204
+
205
+ # if __arm64__ && !__has_feature(ptrauth_calls)
206
+ // When we're built ARM64 but running on ARM64e hardware, we will get an
207
+ // ARM64e libobjc with an ARM64e ISA mask. This mismatch is harmless and we
208
+ // shouldn't assert.
209
+ assert (libObjCMask == SWIFT_ISA_MASK || libObjCMask == SWIFT_ISA_MASK_PTRAUTH);
210
+ # else
211
+ assert (libObjCMask == SWIFT_ISA_MASK);
212
+ # endif
204
213
#endif
205
214
}
206
215
You can’t perform that action at this time.
0 commit comments