diff options
author | Yunzhong Gao <Yunzhong.Gao@sony.com> | 2016-06-30 18:49:04 +0000 |
---|---|---|
committer | Yunzhong Gao <Yunzhong.Gao@sony.com> | 2016-06-30 18:49:04 +0000 |
commit | b386955adc9176c9c3049cbd21ae13bff7508112 (patch) | |
tree | bc75057f76ef9bbc7c85f25f80c706fa56724b1b /llvm/lib/CodeGen/StackProtector.cpp | |
parent | 95685faeee9510665886b77a0ef6fd78c1659e23 (diff) | |
download | bcm5719-llvm-b386955adc9176c9c3049cbd21ae13bff7508112.tar.gz bcm5719-llvm-b386955adc9176c9c3049cbd21ae13bff7508112.zip |
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
llvm-svn: 274263
Diffstat (limited to 'llvm/lib/CodeGen/StackProtector.cpp')
-rw-r--r-- | llvm/lib/CodeGen/StackProtector.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/llvm/lib/CodeGen/StackProtector.cpp b/llvm/lib/CodeGen/StackProtector.cpp index 2912f77810e..89868e43aba 100644 --- a/llvm/lib/CodeGen/StackProtector.cpp +++ b/llvm/lib/CodeGen/StackProtector.cpp @@ -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", |