diff options
Diffstat (limited to 'llvm/lib/CodeGen/SafeStack.cpp')
-rw-r--r-- | llvm/lib/CodeGen/SafeStack.cpp | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/llvm/lib/CodeGen/SafeStack.cpp b/llvm/lib/CodeGen/SafeStack.cpp index da229f8..a6c1a76 100644 --- a/llvm/lib/CodeGen/SafeStack.cpp +++ b/llvm/lib/CodeGen/SafeStack.cpp @@ -475,8 +475,16 @@ void SafeStack::checkStackGuard(IRBuilder<> &IRB, Function &F, Instruction &RI, SplitBlockAndInsertIfThen(Cmp, &RI, /* Unreachable */ true, Weights, DTU); IRBuilder<> IRBFail(CheckTerm); // FIXME: respect -fsanitize-trap / -ftrap-function here? + const char *StackChkFailName = + TL.getLibcallName(RTLIB::STACKPROTECTOR_CHECK_FAIL); + if (!StackChkFailName) { + F.getContext().emitError( + "no libcall available for stackprotector check fail"); + return; + } + FunctionCallee StackChkFail = - F.getParent()->getOrInsertFunction("__stack_chk_fail", IRB.getVoidTy()); + F.getParent()->getOrInsertFunction(StackChkFailName, IRB.getVoidTy()); IRBFail.CreateCall(StackChkFail, {}); } |