Skip to content

Commit f04a0c9

Browse files
committed
IRGen: Only use clang type based task continuation function pointer
descriminator schema if descrimination is requested rdar://99142574
1 parent 47c1fd9 commit f04a0c9

File tree

2 files changed

+5
-3
lines changed

2 files changed

+5
-3
lines changed

lib/IRGen/GenCall.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2732,8 +2732,9 @@ class AsyncCallEmission final : public CallEmission {
27322732
if (auto schema = IGF.IGM.getOptions().PointerAuth.FunctionPointers) {
27332733
// Use the Clang type for TaskContinuationFunction*
27342734
// to make this work with type diversity.
2735-
schema =
2736-
IGF.IGM.getOptions().PointerAuth.ClangTypeTaskContinuationFunction;
2735+
if (schema.hasOtherDiscrimination())
2736+
schema =
2737+
IGF.IGM.getOptions().PointerAuth.ClangTypeTaskContinuationFunction;
27372738
auto authInfo =
27382739
PointerAuthInfo::emit(IGF, schema, nullptr, PointerAuthEntity());
27392740
signedResumeFn = emitPointerAuthSign(IGF, signedResumeFn, authInfo);

lib/IRGen/GenFunc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2471,7 +2471,8 @@ llvm::Function *IRGenFunction::createAsyncSuspendFn() {
24712471
if (auto schema = IGM.getOptions().PointerAuth.FunctionPointers) {
24722472
// Use the Clang type for TaskContinuationFunction*
24732473
// to make this work with type diversity.
2474-
schema = IGM.getOptions().PointerAuth.ClangTypeTaskContinuationFunction;
2474+
if (schema.hasOtherDiscrimination())
2475+
schema = IGM.getOptions().PointerAuth.ClangTypeTaskContinuationFunction;
24752476
auto authInfo = PointerAuthInfo::emit(suspendIGF, schema, nullptr,
24762477
PointerAuthEntity());
24772478
resumeFunction = emitPointerAuthSign(suspendIGF, resumeFunction, authInfo);

0 commit comments

Comments
 (0)