Skip to content

Commit 6d8b0f5

Browse files
committed
Fix invalid pointer authentication lowering for coroutine partial apply.
Fix tests on arm64e
1 parent 68c845a commit 6d8b0f5

File tree

2 files changed

+149
-131
lines changed

2 files changed

+149
-131
lines changed

lib/IRGen/GenFunc.cpp

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1593,10 +1593,14 @@ class CoroPartialApplicationForwarderEmission
15931593

15941594
/// Get the continuation function pointer
15951595
///
1596-
PointerAuthInfo newAuthInfo =
1597-
fnPtr.getAuthInfo().getCorrespondingCodeAuthInfo();
1596+
auto sig = Signature::forCoroutineContinuation(subIGF.IGM, origType);
1597+
auto schemaAndEntity =
1598+
getCoroutineResumeFunctionPointerAuth(subIGF.IGM, origType);
1599+
auto pointerAuth = PointerAuthInfo::emit(subIGF, schemaAndEntity.first,
1600+
calleeHandle,
1601+
schemaAndEntity.second);
15981602
FunctionPointer contFn = FunctionPointer::createSigned(
1599-
FunctionPointer::Kind::Function, yieldedValues.claimNext(), newAuthInfo,
1603+
FunctionPointer::Kind::Function, yieldedValues.claimNext(), pointerAuth,
16001604
Signature::forCoroutineContinuation(subIGF.IGM, origType));
16011605

16021606
/// Forward the remaining yields of the wrapped coroutine

0 commit comments

Comments
 (0)