summaryrefslogtreecommitdiffstats
path: root/gnu/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
diff options
context:
space:
mode:
authormortimer <mortimer@openbsd.org>2019-08-12 23:43:03 +0000
committermortimer <mortimer@openbsd.org>2019-08-12 23:43:03 +0000
commitc45c722e0148301536effe267054bb9575edbf35 (patch)
tree13c832b3f28608527618ef672ac8858e3d303457 /gnu/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
parentsome cleanup: (diff)
downloadwireguard-openbsd-c45c722e0148301536effe267054bb9575edbf35.tar.xz
wireguard-openbsd-c45c722e0148301536effe267054bb9575edbf35.zip
Ensure stack protector slot access is resolved by PEI.
On arm64, arm, and ppc it is possible that a large stack frame will cause the stack protector slot to be reallocated at the wrong end of the frame. Noticed by tj@. ok patrick@.
Diffstat (limited to 'gnu/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp')
-rw-r--r--gnu/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp4
1 files changed, 4 insertions, 0 deletions
diff --git a/gnu/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp b/gnu/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
index 795028e9792..be0cd9072ad 100644
--- a/gnu/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
+++ b/gnu/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp
@@ -344,6 +344,10 @@ bool LocalStackSlotPass::insertFrameReferenceRegisters(MachineFunction &Fn) {
assert(MFI.isObjectPreAllocated(FrameIdx) &&
"Only pre-allocated locals expected!");
+ int StackProtectorFI = MFI.getStackProtectorIndex();
+ if (StackProtectorFI >= 0 && StackProtectorFI == FrameIdx)
+ continue;
+
LLVM_DEBUG(dbgs() << "Considering: " << MI);
unsigned idx = 0;