@@ -2309,30 +2309,33 @@ void DynamicReplacementDescriptor::enableReplacement() const {
23092309 auto *previous = chainRoot->next ;
23102310 chainRoot->next = previous->next ;
23112311 // 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 ());
23162317 }
23172318
23182319 // First populate the current replacement's chain entry.
23192320 auto *currentEntry =
23202321 const_cast <DynamicReplacementChainEntry *>(chainEntry.get ());
23212322 // currentEntry->implementationFunction = chainRoot->implementationFunction;
2322- swift_ptrauth_copy (
2323+ swift_ptrauth_copy_code_or_data (
23232324 reinterpret_cast <void **>(¤tEntry->implementationFunction ),
23242325 reinterpret_cast <void *const *>(&chainRoot->implementationFunction ),
2325- replacedFunctionKey->getExtraDiscriminator ());
2326+ replacedFunctionKey->getExtraDiscriminator (),
2327+ !replacedFunctionKey->isAsync ());
23262328
23272329 currentEntry->next = chainRoot->next ;
23282330
23292331 // Link the replacement entry.
23302332 chainRoot->next = chainEntry.get ();
23312333 // chainRoot->implementationFunction = replacementFunction.get();
2332- swift_ptrauth_init (
2334+ swift_ptrauth_init_code_or_data (
23332335 reinterpret_cast <void **>(&chainRoot->implementationFunction ),
23342336 reinterpret_cast <void *>(replacementFunction.get ()),
2335- replacedFunctionKey->getExtraDiscriminator ());
2337+ replacedFunctionKey->getExtraDiscriminator (),
2338+ !replacedFunctionKey->isAsync ());
23362339}
23372340
23382341void DynamicReplacementDescriptor::disableReplacement () const {
@@ -2353,10 +2356,11 @@ void DynamicReplacementDescriptor::disableReplacement() const {
23532356 auto *previous = const_cast <DynamicReplacementChainEntry *>(prev);
23542357 previous->next = thisEntry->next ;
23552358 // previous->implementationFunction = thisEntry->implementationFunction;
2356- swift_ptrauth_copy (
2359+ swift_ptrauth_copy_code_or_data (
23572360 reinterpret_cast <void **>(&previous->implementationFunction ),
23582361 reinterpret_cast <void *const *>(&thisEntry->implementationFunction ),
2359- replacedFunctionKey->getExtraDiscriminator ());
2362+ replacedFunctionKey->getExtraDiscriminator (),
2363+ !replacedFunctionKey->isAsync ());
23602364}
23612365
23622366// / An automatic dymamic replacement entry.
0 commit comments