Skip to content

Commit 002d746

Browse files
composerinteraliaXrXr
authored andcommitted
ZJIT: Avoid double negative in Mem debug
Prior to this commit the debug output for negative offsets would look like: ``` Mem64[Reg(3) - -8 ``` That makes it look like we're adding instead of subtracting. After this commit we'll print: ``` Mem64[Reg(3) - 8 ```
1 parent d0fdbef commit 002d746

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

zjit/src/backend/lir.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ impl fmt::Debug for Mem {
4545
write!(fmt, "Mem{}[{:?}", self.num_bits, self.base)?;
4646
if self.disp != 0 {
4747
let sign = if self.disp > 0 { '+' } else { '-' };
48-
write!(fmt, " {sign} {}", self.disp)?;
48+
write!(fmt, " {sign} {}", self.disp.abs())?;
4949
}
5050

5151
write!(fmt, "]")

0 commit comments

Comments
 (0)