mirror of
https://github.com/apple/swift.git
synced 2025-12-21 12:14:44 +01:00
[Runtime][IRGen] Sign type context descriptor pointers.
Ensure that context descriptor pointers are signed in the runtime by putting the ptrauth_struct attribute on the types. We use the new __builtin_ptrauth_struct_key/disc to conditionally apply ptrauth_struct to TrailingObjects based on the signing of the base type, so that pointers to TrailingObjects get signed when used with a context descriptor pointer. We add new runtime entrypoints that take signed pointers where appropriate, and have the compiler emit calls to the new entrypoints when targeting a sufficiently new OS. rdar://111480914
This commit is contained in:
@@ -519,7 +519,7 @@ bool swift::_conformsToProtocol(const OpaqueValue *value,
|
||||
const WitnessTable **conformance) {
|
||||
// Look up the witness table for protocols that need them.
|
||||
if (protocol.needsWitnessTable()) {
|
||||
auto witness = swift_conformsToProtocol(type, protocol.getSwiftProtocol());
|
||||
auto witness = swift_conformsToProtocolCommon(type, protocol.getSwiftProtocol());
|
||||
if (!witness)
|
||||
return false;
|
||||
if (conformance)
|
||||
@@ -1349,7 +1349,7 @@ extern "C" const StructDescriptor NOMINAL_TYPE_DESCR_SYM(SS);
|
||||
static const _ObjectiveCBridgeableWitnessTable *
|
||||
swift_conformsToObjectiveCBridgeable(const Metadata *T) {
|
||||
return reinterpret_cast<const _ObjectiveCBridgeableWitnessTable *>
|
||||
(swift_conformsToProtocol(T, &PROTOCOL_DESCR_SYM(s21_ObjectiveCBridgeable)));
|
||||
(swift_conformsToProtocolCommon(T, &PROTOCOL_DESCR_SYM(s21_ObjectiveCBridgeable)));
|
||||
}
|
||||
|
||||
static const _ObjectiveCBridgeableWitnessTable *
|
||||
|
||||
Reference in New Issue
Block a user