Skip to content

[Runtime] Add ptrauth attribute to TargetGlobalActorReference conformance pointer. #81824

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
May 29, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion include/swift/ABI/Metadata.h
Original file line number Diff line number Diff line change
Expand Up @@ -2787,11 +2787,22 @@ using ResilientWitnessesHeader = TargetResilientWitnessesHeader<InProcess>;
/// global actor protocol.
template<typename Runtime>
struct TargetGlobalActorReference {
private:
using SignedDescriptorPointer =
const TargetProtocolConformanceDescriptor<Runtime>
*__ptrauth_swift_protocol_conformance_descriptor;

public:
/// The type of the global actor.
RelativeDirectPointer<const char, /*nullable*/ false> type;

/// The conformance of the global actor to the GlobalActor protocol.
TargetRelativeProtocolConformanceDescriptorPointer<Runtime> conformance;
RelativeIndirectablePointer<
const TargetProtocolConformanceDescriptor<Runtime>,
/*nullable*/ false,
/*offset*/ int32_t,
/*indirect type*/ SignedDescriptorPointer>
conformance;
};

/// Describes the context of a protocol conformance that is relevant when
Expand Down
4 changes: 4 additions & 0 deletions include/swift/Runtime/Config.h
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,9 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL
#define __ptrauth_swift_type_descriptor \
__ptrauth(ptrauth_key_process_independent_data, 1, \
SpecialPointerAuthDiscriminators::TypeDescriptor)
#define __ptrauth_swift_protocol_conformance_descriptor \
__ptrauth(ptrauth_key_process_independent_data, 1, \
SpecialPointerAuthDiscriminators::ProtocolConformanceDescriptor)
#define __ptrauth_swift_dynamic_replacement_key \
__ptrauth(ptrauth_key_process_independent_data, 1, \
SpecialPointerAuthDiscriminators::DynamicReplacementKey)
Expand Down Expand Up @@ -365,6 +368,7 @@ extern uintptr_t __COMPATIBILITY_LIBRARIES_CANNOT_CHECK_THE_IS_SWIFT_BIT_DIRECTL
#define __ptrauth_swift_runtime_function_entry_strip(__fn) (__fn)
#define __ptrauth_swift_heap_object_destructor
#define __ptrauth_swift_type_descriptor
#define __ptrauth_swift_protocol_conformance_descriptor
#define __ptrauth_swift_nonunique_extended_existential_type_shape
#define __ptrauth_swift_dynamic_replacement_key
#define swift_ptrauth_sign_opaque_read_resume_function(__fn, __buffer) (__fn)
Expand Down