diff options
author | 2017-01-20 23:18:39 +0000 | |
---|---|---|
committer | 2017-01-20 23:18:39 +0000 | |
commit | aa9d6a08e9f5c6963f1f27aca24d483ba002f6a3 (patch) | |
tree | 014a979f53fe21b7e79f7cbfd84728f6d9a9ddde | |
parent | Use a global variable PUB_KEY for the location of the key file. (diff) | |
download | wireguard-openbsd-aa9d6a08e9f5c6963f1f27aca24d483ba002f6a3.tar.xz wireguard-openbsd-aa9d6a08e9f5c6963f1f27aca24d483ba002f6a3.zip |
Restore setting the visibility of __guard_local to hidden for better
code generation. Use dyn_case_or_null instead of a static cast to
solve the crashes in the previous code.
ok stefan@ kettenis@
-rw-r--r-- | gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp b/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp index 8ca2bf9e86d..dc01d160e10 100644 --- a/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp +++ b/gnu/llvm/lib/CodeGen/TargetLoweringBase.cpp @@ -1818,7 +1818,10 @@ Value *TargetLoweringBase::getIRStackGuard(IRBuilder<> &IRB) const { if (getTargetMachine().getTargetTriple().isOSOpenBSD()) { Module &M = *IRB.GetInsertBlock()->getParent()->getParent(); PointerType *PtrTy = Type::getInt8PtrTy(M.getContext()); - return M.getOrInsertGlobal("__guard_local", PtrTy); + Constant *C = M.getOrInsertGlobal("__guard_local", PtrTy); + if (GlobalVariable *G = dyn_cast_or_null<GlobalVariable>(C)) + G->setVisibility(GlobalValue::HiddenVisibility); + return C; } return nullptr; } |