File tree Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Expand file tree Collapse file tree 1 file changed +13
-6
lines changed Original file line number Diff line number Diff line change @@ -5030,16 +5030,23 @@ Callee irgen::getSwiftFunctionPointerCallee(
5030
5030
return Callee (std::move (calleeInfo), fn, dataPtr);
5031
5031
}
5032
5032
5033
- Callee irgen::getCFunctionPointerCallee (IRGenFunction &IGF,
5034
- llvm::Value *fnPtr,
5033
+ Callee irgen::getCFunctionPointerCallee (IRGenFunction &IGF, llvm::Value *fnPtr,
5035
5034
CalleeInfo &&calleeInfo) {
5036
5035
auto sig = emitCastOfFunctionPointer (IGF, fnPtr, calleeInfo.OrigFnType );
5037
- auto authInfo =
5038
- PointerAuthInfo::forFunctionPointer (IGF.IGM , calleeInfo.OrigFnType );
5039
5036
5040
- auto fn = FunctionPointer::createSigned (FunctionPointer::Kind::Function,
5041
- fnPtr, authInfo, sig);
5037
+ if (!IGF.getSILModule ()
5038
+ .getOptions ()
5039
+ .EnableImportPtrauthFieldFunctionPointers ) {
5040
+ auto sig = emitCastOfFunctionPointer (IGF, fnPtr, calleeInfo.OrigFnType );
5041
+ auto authInfo =
5042
+ PointerAuthInfo::forFunctionPointer (IGF.IGM , calleeInfo.OrigFnType );
5042
5043
5044
+ auto fn = FunctionPointer::createSigned (FunctionPointer::Kind::Function,
5045
+ fnPtr, authInfo, sig);
5046
+ return Callee (std::move (calleeInfo), fn);
5047
+ }
5048
+ auto fn = FunctionPointer::createUnsigned (FunctionPointer::Kind::Function,
5049
+ fnPtr, sig);
5043
5050
return Callee (std::move (calleeInfo), fn);
5044
5051
}
5045
5052
You can’t perform that action at this time.
0 commit comments