Skip to content

Commit a23e169

Browse files
authored
Merge pull request #37984 from aschwaighofer/fix_task_wait_arm64e
Fix taskWait function family calls on arm64e
2 parents 53f4da3 + 1cf63f8 commit a23e169

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
@@ -2624,7 +2624,16 @@ class AsyncCallEmission final : public CallEmission {
26242624
assert(currentResumeFn == nullptr);
26252625
currentResumeFn =
26262626
IGF.Builder.CreateIntrinsicCall(llvm::Intrinsic::coro_async_resume, {});
2627-
return currentResumeFn;
2627+
auto signedResumeFn = currentResumeFn;
2628+
// Sign the task resume function with the C function pointer schema.
2629+
if (auto schema = IGF.IGM.getOptions().PointerAuth.FunctionPointers) {
2630+
// TODO: use the Clang type for TaskContinuationFunction*
2631+
// to make this work with type diversity.
2632+
auto authInfo =
2633+
PointerAuthInfo::emit(IGF, schema, nullptr, PointerAuthEntity());
2634+
signedResumeFn = emitPointerAuthSign(IGF, signedResumeFn, authInfo);
2635+
}
2636+
return signedResumeFn;
26282637
}
26292638

26302639

0 commit comments

Comments
 (0)