summaryrefslogtreecommitdiff
path: root/lib/MC/MCStreamer.cpp
diff options
context:
space:
mode:
authorKai Nacke <kai.nacke@redstar.de>2013-07-06 17:15:36 +0000
committerKai Nacke <kai.nacke@redstar.de>2013-07-06 17:15:36 +0000
commitea434e4bca15383418ac65788fdb8bc3b5725fe2 (patch)
tree11e264bbe6f2530a1d914fbad420f9896e69bb81 /lib/MC/MCStreamer.cpp
parent34ae5725c0e5ba7fb26fb348b079e18182c5d891 (diff)
downloadllvm-ea434e4bca15383418ac65788fdb8bc3b5725fe2.tar.gz
llvm-ea434e4bca15383418ac65788fdb8bc3b5725fe2.tar.bz2
llvm-ea434e4bca15383418ac65788fdb8bc3b5725fe2.tar.xz
Fix wrong code offset for unwind code SET_FPREG.
The code offset for unwind code SET_FPREG is wrong because it is set to constant 0. The fix is to do the same as for the other unwind codes: emit a label and later the absolute difference between the label and the begin of the prologue. Also enables the failing test case MC/COFF/seh.s Reviewed by Charles Davis and Nico Rieck. git-svn-id: https://llvm.org/svn/llvm-project/llvm/trunk@185758 91177308-0d34-0410-b5e6-96231b3b80d8
Diffstat (limited to 'lib/MC/MCStreamer.cpp')
-rw-r--r--lib/MC/MCStreamer.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/lib/MC/MCStreamer.cpp b/lib/MC/MCStreamer.cpp
index 6542f42a03..fb43a4adbd 100644
--- a/lib/MC/MCStreamer.cpp
+++ b/lib/MC/MCStreamer.cpp
@@ -470,7 +470,9 @@ void MCStreamer::EmitWin64EHSetFrame(unsigned Register, unsigned Offset) {
report_fatal_error("Frame register and offset already specified!");
if (Offset & 0x0F)
report_fatal_error("Misaligned frame pointer offset!");
- MCWin64EHInstruction Inst(Win64EH::UOP_SetFPReg, 0, Register, Offset);
+ MCSymbol *Label = getContext().CreateTempSymbol();
+ MCWin64EHInstruction Inst(Win64EH::UOP_SetFPReg, Label, Register, Offset);
+ EmitLabel(Label);
CurFrame->LastFrameInst = CurFrame->Instructions.size();
CurFrame->Instructions.push_back(Inst);
}