1
0
mirror of https://github.com/RPCS3/llvm-mirror.git synced 2025-02-01 05:01:59 +01:00

[MC] Fix double negation of DW_CFA_def_cfa_offset

Negations are incorrectly added in two places and the code works just
because the negations cancel each other.
This commit is contained in:
Fangrui Song 2020-05-22 19:57:21 -07:00
parent 886a960f92
commit 85df10d8f5
2 changed files with 2 additions and 2 deletions

View File

@ -1394,7 +1394,7 @@ void FrameEmitterImpl::emitCFIInstruction(const MCCFIInstruction &Instr) {
if (IsRelative)
CFAOffset += Instr.getOffset();
else
CFAOffset = -Instr.getOffset();
CFAOffset = Instr.getOffset();
Streamer.emitULEB128IntValue(CFAOffset);

View File

@ -472,7 +472,7 @@ void MCStreamer::emitCFIDefCfa(int64_t Register, int64_t Offset) {
void MCStreamer::emitCFIDefCfaOffset(int64_t Offset) {
MCSymbol *Label = emitCFILabel();
MCCFIInstruction Instruction =
MCCFIInstruction::cfiDefCfaOffset(Label, -Offset);
MCCFIInstruction::cfiDefCfaOffset(Label, Offset);
MCDwarfFrameInfo *CurFrame = getCurrentDwarfFrameInfo();
if (!CurFrame)
return;