Skip to content

Commit 540f69a

Browse files
authored
Merge pull request #81825 from mikeash/globalactorreference-ptrauth-6.2
[6.2][Runtime] Add ptrauth attribute to TargetGlobalActorReference conformance pointer.
2 parents 363a5c7 + b04c7d4 commit 540f69a

File tree

2 files changed

+16
-1
lines changed

2 files changed

+16
-1
lines changed

include/swift/ABI/Metadata.h

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2792,11 +2792,22 @@ using ResilientWitnessesHeader = TargetResilientWitnessesHeader<InProcess>;
27922792
/// global actor protocol.
27932793
template<typename Runtime>
27942794
struct TargetGlobalActorReference {
2795+
private:
2796+
using SignedDescriptorPointer =
2797+
const TargetProtocolConformanceDescriptor<Runtime>
2798+
*__ptrauth_swift_protocol_conformance_descriptor;
2799+
2800+
public:
27952801
/// The type of the global actor.
27962802
RelativeDirectPointer<const char, /*nullable*/ false> type;
27972803

27982804
/// The conformance of the global actor to the GlobalActor protocol.
2799-
TargetRelativeProtocolConformanceDescriptorPointer<Runtime> conformance;
2805+
RelativeIndirectablePointer<
2806+
const TargetProtocolConformanceDescriptor<Runtime>,
2807+
/*nullable*/ false,
2808+
/*offset*/ int32_t,
2809+
/*indirect type*/ SignedDescriptorPointer>
2810+
conformance;
28002811
};
28012812

28022813
/// Describes the context of a protocol conformance that is relevant when

include/swift/Runtime/Config.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -272,6 +272,9 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL
272272
#define __ptrauth_swift_type_descriptor \
273273
__ptrauth(ptrauth_key_process_independent_data, 1, \
274274
SpecialPointerAuthDiscriminators::TypeDescriptor)
275+
#define __ptrauth_swift_protocol_conformance_descriptor \
276+
__ptrauth(ptrauth_key_process_independent_data, 1, \
277+
SpecialPointerAuthDiscriminators::ProtocolConformanceDescriptor)
275278
#define __ptrauth_swift_dynamic_replacement_key \
276279
__ptrauth(ptrauth_key_process_independent_data, 1, \
277280
SpecialPointerAuthDiscriminators::DynamicReplacementKey)
@@ -365,6 +368,7 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL
365368
#define __ptrauth_swift_runtime_function_entry_strip(__fn) (__fn)
366369
#define __ptrauth_swift_heap_object_destructor
367370
#define __ptrauth_swift_type_descriptor
371+
#define __ptrauth_swift_protocol_conformance_descriptor
368372
#define __ptrauth_swift_nonunique_extended_existential_type_shape
369373
#define __ptrauth_swift_dynamic_replacement_key
370374
#define swift_ptrauth_sign_opaque_read_resume_function(__fn, __buffer) (__fn)

0 commit comments

Comments
 (0)