summaryrefslogtreecommitdiffstats
path: root/llvm/lib
diff options
context:
space:
mode:
authorReid Kleckner <rnk@google.com>2019-08-12 23:02:00 +0000
committerReid Kleckner <rnk@google.com>2019-08-12 23:02:00 +0000
commite9865b9b31bb2e6bc742dc6fca8f9f9517c3c43e (patch)
tree50e0df5dc2034268ff04383c7cb760104502f743 /llvm/lib
parentb978c51ce4e99978ba526e7a5b69fe110dba396b (diff)
downloadbcm5719-llvm-e9865b9b31bb2e6bc742dc6fca8f9f9517c3c43e.tar.gz
bcm5719-llvm-e9865b9b31bb2e6bc742dc6fca8f9f9517c3c43e.zip
[WinEH] Fix catch block parent frame pointer offset
r367088 made it so that funclets store XMM registers into their local frame instead of storing them to the parent frame. However, that change forgot to update the parent frame pointer offset for catch blocks. This change does that. Fixes crashes when an exception is rethrown in a catch block that saves XMMs, as described in https://crbug.com/992860. llvm-svn: 368631
Diffstat (limited to 'llvm/lib')
-rw-r--r--llvm/lib/Target/X86/X86FrameLowering.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/llvm/lib/Target/X86/X86FrameLowering.cpp b/llvm/lib/Target/X86/X86FrameLowering.cpp
index 47be92e5972..9d8cb89dbef 100644
--- a/llvm/lib/Target/X86/X86FrameLowering.cpp
+++ b/llvm/lib/Target/X86/X86FrameLowering.cpp
@@ -3191,14 +3191,19 @@ void X86FrameLowering::orderFrameObjects(
std::reverse(ObjectsToAllocate.begin(), ObjectsToAllocate.end());
}
-
-unsigned X86FrameLowering::getWinEHParentFrameOffset(const MachineFunction &MF) const {
+unsigned
+X86FrameLowering::getWinEHParentFrameOffset(const MachineFunction &MF) const {
+ const X86MachineFunctionInfo *X86FI = MF.getInfo<X86MachineFunctionInfo>();
// RDX, the parent frame pointer, is homed into 16(%rsp) in the prologue.
unsigned Offset = 16;
// RBP is immediately pushed.
Offset += SlotSize;
// All callee-saved registers are then pushed.
- Offset += MF.getInfo<X86MachineFunctionInfo>()->getCalleeSavedFrameSize();
+ Offset += X86FI->getCalleeSavedFrameSize();
+ // Funclets allocate space for however XMM registers are required.
+ int Ignore;
+ if (MF.getTarget().getMCAsmInfo()->usesWindowsCFI())
+ Offset += X86FI->getCalleeSavedXMMFrameInfo(Ignore);
// Every funclet allocates enough stack space for the largest outgoing call.
Offset += getWinEHFuncletFrameSize(MF);
return Offset;
OpenPOWER on IntegriCloud