Skip to content

Commit 4c81f06

Browse files
Merge pull request swiftlang#36843 from nate-chandler/ptrauth-fixup-paf-callee-authinfo
[ptrauth] Adapted authinfo for async PAF callees.
2 parents 5cf19e4 + faa814c commit 4c81f06

File tree

1 file changed

+7
-2
lines changed

1 file changed

+7
-2
lines changed

lib/IRGen/GenFunc.cpp

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1169,9 +1169,14 @@ class AsyncPartialApplicationForwarderEmission
11691169
return fnPtr;
11701170
}
11711171
llvm::CallInst *createCall(FunctionPointer &fnPtr) override {
1172+
PointerAuthInfo newAuthInfo;
1173+
if (auto authInfo = fnPtr.getAuthInfo()) {
1174+
newAuthInfo = PointerAuthInfo(authInfo.getCorrespondingCodeKey(),
1175+
authInfo.getDiscriminator());
1176+
}
11721177
auto newFnPtr = FunctionPointer(
1173-
FunctionPointer::Kind::Function, fnPtr.getPointer(subIGF),
1174-
fnPtr.getAuthInfo(), Signature::forAsyncAwait(subIGF.IGM, origType));
1178+
FunctionPointer::Kind::Function, fnPtr.getPointer(subIGF), newAuthInfo,
1179+
Signature::forAsyncAwait(subIGF.IGM, origType));
11751180
auto &Builder = subIGF.Builder;
11761181

11771182
auto argValues = args.claimAll();

0 commit comments

Comments
 (0)