File tree Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Expand file tree Collapse file tree 2 files changed +9
-4
lines changed Original file line number Diff line number Diff line change @@ -33,9 +33,14 @@ extern "C" {
33
33
34
34
typedef void SWIFT_CC (*HeapObjectDestroyer)(SWIFT_CONTEXT void *object);
35
35
36
- static inline void _swift_runtime_invoke_heap_object_destroy (
37
- const void *destroy, void *self) {
38
- ((HeapObjectDestroyer)destroy)(self);
36
+ static inline void _swift_embedded_invoke_heap_object_destroy (void *object) {
37
+ void *metadata = *(void **)object;
38
+ void **destroy_location = &((void **)metadata)[1 ];
39
+ #if __has_feature(ptrauth_calls)
40
+ (*(__ptrauth (0 ,1 ,0xbbbf ) HeapObjectDestroyer *)destroy_location)(object);
41
+ #else
42
+ (*(HeapObjectDestroyer *)destroy_location)(object);
43
+ #endif
39
44
}
40
45
41
46
#ifdef __cplusplus
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ public func swift_release(object: Builtin.RawPointer) {
117
117
if o. pointee. refcount == HeapObject . immortalRefCount { return }
118
118
o. pointee. refcount -= 1
119
119
if ( o. pointee. refcount & HeapObject . refcountMask) == 0 {
120
- _swift_runtime_invoke_heap_object_destroy ( o . pointee . metadata . pointee . destroy , o)
120
+ _swift_embedded_invoke_heap_object_destroy ( o)
121
121
}
122
122
}
123
123
You can’t perform that action at this time.
0 commit comments