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" {
3333
3434typedef void SWIFT_CC (*HeapObjectDestroyer)(SWIFT_CONTEXT void *object);
3535
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
3944}
4045
4146#ifdef __cplusplus
Original file line number Diff line number Diff line change @@ -117,7 +117,7 @@ public func swift_release(object: Builtin.RawPointer) {
117117 if o. pointee. refcount == HeapObject . immortalRefCount { return }
118118 o. pointee. refcount -= 1
119119 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)
121121 }
122122}
123123
You can’t perform that action at this time.
0 commit comments