Skip to content

Commit f40d349

Browse files
authored
Merge pull request swiftlang#37985 from aschwaighofer/fix_task_wait_arm64e_5.5
[5.5] Fix taskWait function family calls on arm64e
2 parents d6f3d3a + 96be1e0 commit f40d349

File tree

1 file changed

+10
-1
lines changed

1 file changed

+10
-1
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2623,7 +2623,16 @@ class AsyncCallEmission final : public CallEmission {
26232623
assert(currentResumeFn == nullptr);
26242624
currentResumeFn =
26252625
IGF.Builder.CreateIntrinsicCall(llvm::Intrinsic::coro_async_resume, {});
2626-
return currentResumeFn;
2626+
auto signedResumeFn = currentResumeFn;
2627+
// Sign the task resume function with the C function pointer schema.
2628+
if (auto schema = IGF.IGM.getOptions().PointerAuth.FunctionPointers) {
2629+
// TODO: use the Clang type for TaskContinuationFunction*
2630+
// to make this work with type diversity.
2631+
auto authInfo =
2632+
PointerAuthInfo::emit(IGF, schema, nullptr, PointerAuthEntity());
2633+
signedResumeFn = emitPointerAuthSign(IGF, signedResumeFn, authInfo);
2634+
}
2635+
return signedResumeFn;
26272636
}
26282637

26292638

0 commit comments

Comments
 (0)