diff options
| author | 2019-08-12 23:43:03 +0000 | |
|---|---|---|
| committer | 2019-08-12 23:43:03 +0000 | |
| commit | c45c722e0148301536effe267054bb9575edbf35 (patch) | |
| tree | 13c832b3f28608527618ef672ac8858e3d303457 /gnu/llvm/lib/CodeGen/LocalStackSlotAllocation.cpp | |
| parent | some cleanup: (diff) | |
| download | wireguard-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.cpp | 4 |
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; |
