mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[metadata prespecialization] Ptrauth for compared protocol conformances.
Two protocol conformance descriptors are passed to swift_compareProtocolConformanceDecriptors from generic metadata accessors when there is a canonical prespecialization and one of the generic arguments has a protocol requirement. Previously, the descriptors were incorrectly being passed without ptrauth processing: one from the witness table in the arguments that are passed in to the accessor and one known statically. Here, the descriptor in the witness table is authed using the ProtocolConformanceDescriptor schema. Then, both descriptors are signed using the ProtocolConformanceDescriptorsAsArguments schema. Finally, in the runtime function, the descriptors are authed.
This commit is contained in:
@@ -309,6 +309,9 @@ PointerAuthEntity::getDeclDiscriminator(IRGenModule &IGM) const {
|
||||
case Special::TypeDescriptor:
|
||||
case Special::TypeDescriptorAsArgument:
|
||||
return SpecialPointerAuthDiscriminators::TypeDescriptor;
|
||||
case Special::ProtocolConformanceDescriptor:
|
||||
case Special::ProtocolConformanceDescriptorAsArgument:
|
||||
return SpecialPointerAuthDiscriminators::ProtocolConformanceDescriptor;
|
||||
case Special::PartialApplyCapture:
|
||||
return PointerAuthDiscriminator_PartialApplyCapture;
|
||||
case Special::KeyPathDestroy:
|
||||
|
||||
Reference in New Issue
Block a user