@@ -2309,30 +2309,33 @@ void DynamicReplacementDescriptor::enableReplacement() const {
2309
2309
auto *previous = chainRoot->next ;
2310
2310
chainRoot->next = previous->next ;
2311
2311
// chainRoot->implementationFunction = previous->implementationFunction;
2312
- swift_ptrauth_copy (
2313
- reinterpret_cast <void **>(&chainRoot->implementationFunction ),
2314
- reinterpret_cast <void *const *>(&previous->implementationFunction ),
2315
- replacedFunctionKey->getExtraDiscriminator ());
2312
+ swift_ptrauth_copy_code_or_data (
2313
+ reinterpret_cast <void **>(&chainRoot->implementationFunction ),
2314
+ reinterpret_cast <void *const *>(&previous->implementationFunction ),
2315
+ replacedFunctionKey->getExtraDiscriminator (),
2316
+ !replacedFunctionKey->isAsync ());
2316
2317
}
2317
2318
2318
2319
// First populate the current replacement's chain entry.
2319
2320
auto *currentEntry =
2320
2321
const_cast <DynamicReplacementChainEntry *>(chainEntry.get ());
2321
2322
// currentEntry->implementationFunction = chainRoot->implementationFunction;
2322
- swift_ptrauth_copy (
2323
+ swift_ptrauth_copy_code_or_data (
2323
2324
reinterpret_cast <void **>(¤tEntry->implementationFunction ),
2324
2325
reinterpret_cast <void *const *>(&chainRoot->implementationFunction ),
2325
- replacedFunctionKey->getExtraDiscriminator ());
2326
+ replacedFunctionKey->getExtraDiscriminator (),
2327
+ !replacedFunctionKey->isAsync ());
2326
2328
2327
2329
currentEntry->next = chainRoot->next ;
2328
2330
2329
2331
// Link the replacement entry.
2330
2332
chainRoot->next = chainEntry.get ();
2331
2333
// chainRoot->implementationFunction = replacementFunction.get();
2332
- swift_ptrauth_init (
2334
+ swift_ptrauth_init_code_or_data (
2333
2335
reinterpret_cast <void **>(&chainRoot->implementationFunction ),
2334
2336
reinterpret_cast <void *>(replacementFunction.get ()),
2335
- replacedFunctionKey->getExtraDiscriminator ());
2337
+ replacedFunctionKey->getExtraDiscriminator (),
2338
+ !replacedFunctionKey->isAsync ());
2336
2339
}
2337
2340
2338
2341
void DynamicReplacementDescriptor::disableReplacement () const {
@@ -2353,10 +2356,11 @@ void DynamicReplacementDescriptor::disableReplacement() const {
2353
2356
auto *previous = const_cast <DynamicReplacementChainEntry *>(prev);
2354
2357
previous->next = thisEntry->next ;
2355
2358
// previous->implementationFunction = thisEntry->implementationFunction;
2356
- swift_ptrauth_copy (
2359
+ swift_ptrauth_copy_code_or_data (
2357
2360
reinterpret_cast <void **>(&previous->implementationFunction ),
2358
2361
reinterpret_cast <void *const *>(&thisEntry->implementationFunction ),
2359
- replacedFunctionKey->getExtraDiscriminator ());
2362
+ replacedFunctionKey->getExtraDiscriminator (),
2363
+ !replacedFunctionKey->isAsync ());
2360
2364
}
2361
2365
2362
2366
// / An automatic dymamic replacement entry.
0 commit comments