diff options
author | Kai Nacke <kai.nacke@redstar.de> | 2013-07-06 17:15:36 +0000 |
---|---|---|
committer | Kai Nacke <kai.nacke@redstar.de> | 2013-07-06 17:15:36 +0000 |
commit | ea434e4bca15383418ac65788fdb8bc3b5725fe2 (patch) | |
tree | 11e264bbe6f2530a1d914fbad420f9896e69bb81 /lib/MC/MCWin64EH.cpp | |
parent | 34ae5725c0e5ba7fb26fb348b079e18182c5d891 (diff) | |
download | external_llvm-ea434e4bca15383418ac65788fdb8bc3b5725fe2.zip external_llvm-ea434e4bca15383418ac65788fdb8bc3b5725fe2.tar.gz external_llvm-ea434e4bca15383418ac65788fdb8bc3b5725fe2.tar.bz2 |
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/MCWin64EH.cpp')
-rw-r--r-- | lib/MC/MCWin64EH.cpp | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/MC/MCWin64EH.cpp b/lib/MC/MCWin64EH.cpp index c5b637c..8db1fa2 100644 --- a/lib/MC/MCWin64EH.cpp +++ b/lib/MC/MCWin64EH.cpp @@ -64,7 +64,7 @@ static void EmitAbsDifference(MCStreamer &streamer, MCSymbol *lhs, static void EmitUnwindCode(MCStreamer &streamer, MCSymbol *begin, MCWin64EHInstruction &inst) { - uint8_t b1, b2; + uint8_t b2; uint16_t w; b2 = (inst.getOperation() & 0x0F); switch (inst.getOperation()) { @@ -93,8 +93,7 @@ static void EmitUnwindCode(MCStreamer &streamer, MCSymbol *begin, streamer.EmitIntValue(b2, 1); break; case Win64EH::UOP_SetFPReg: - b1 = inst.getOffset() & 0xF0; - streamer.EmitIntValue(b1, 1); + EmitAbsDifference(streamer, inst.getLabel(), begin); streamer.EmitIntValue(b2, 1); break; case Win64EH::UOP_SaveNonVol: |