mirror of
https://github.com/RPCS3/llvm.git
synced 2026-07-21 03:05:26 -04:00
Add an artificial line-0 debug location when the compiler emits a call to
__stack_chk_fail(). This avoids a compiler crash. Differential Revision: http://reviews.llvm.org/D21818 git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@274263 91177308-0d34-0410-b5e6-96231b3b80d8
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
#include "llvm/IR/Attributes.h"
|
||||
#include "llvm/IR/Constants.h"
|
||||
#include "llvm/IR/DataLayout.h"
|
||||
#include "llvm/IR/DebugInfo.h"
|
||||
#include "llvm/IR/DerivedTypes.h"
|
||||
#include "llvm/IR/Function.h"
|
||||
#include "llvm/IR/GlobalValue.h"
|
||||
@@ -447,6 +448,7 @@ BasicBlock *StackProtector::CreateFailBB() {
|
||||
LLVMContext &Context = F->getContext();
|
||||
BasicBlock *FailBB = BasicBlock::Create(Context, "CallStackCheckFailBlk", F);
|
||||
IRBuilder<> B(FailBB);
|
||||
B.SetCurrentDebugLocation(DebugLoc::get(0, 0, F->getSubprogram()));
|
||||
if (Trip.isOSOpenBSD()) {
|
||||
Constant *StackChkFail =
|
||||
M->getOrInsertFunction("__stack_smash_handler",
|
||||
|
||||
Reference in New Issue
Block a user