Skip to content

Commit f616e8e

Browse files
author
Mikhail Gudim
committed
[CFIInserter] Fix handling of OpRelOffset.
The variable `SetOffset` holds the offset of CFA from CFA register. The cfi_rel_offset directive means we should add relative offset to `SetOffset`.
1 parent 67f59a6 commit f616e8e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

llvm/lib/CodeGen/CFIInstrInserter.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -217,7 +217,7 @@ void CFIInstrInserter::calculateOutgoingCFAInfo(MBBCFAInfo &MBBInfo) {
217217
CSRReg = CFI.getRegister2();
218218
break;
219219
case MCCFIInstruction::OpRelOffset:
220-
CSROffset = CFI.getOffset() - SetOffset;
220+
CSROffset = CFI.getOffset() + SetOffset;
221221
break;
222222
case MCCFIInstruction::OpRestore:
223223
CSRRestored.set(CFI.getRegister());

0 commit comments

Comments
 (0)