aboutsummaryrefslogtreecommitdiff
path: root/src/real_mode
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2024-06-23 15:31:25 -0700
committeriximeow <me@iximeow.net>2024-06-23 15:31:25 -0700
commit1fdd243276d7184bbc0acb0bda349283cf8cfbda (patch)
treec97e431bcd9be28b5ca1276a019c72b0c7e1ab07 /src/real_mode
parent9d9bb9b8fbc5a04f40b927093cd3ba8e562f941d (diff)
fuzz caught negation bug
Diffstat (limited to 'src/real_mode')
-rw-r--r--src/real_mode/display.rs14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/real_mode/display.rs b/src/real_mode/display.rs
index fdd51cf..8de8168 100644
--- a/src/real_mode/display.rs
+++ b/src/real_mode/display.rs
@@ -415,7 +415,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T>
let mut v = disp as u32;
if disp < 0 {
self.f.write_fixed_size("- 0x")?;
- v = -disp as u32;
+ v = disp.unsigned_abs();
} else {
self.f.write_fixed_size("+ 0x")?;
}
@@ -448,7 +448,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T>
let mut v = disp as u32;
if disp < 0 {
self.f.write_fixed_size("- 0x")?;
- v = -disp as u32;
+ v = disp.unsigned_abs();
} else {
self.f.write_fixed_size("+ 0x")?;
}
@@ -478,7 +478,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T>
let mut v = disp as u32;
if disp < 0 {
self.f.write_fixed_size("- 0x")?;
- v = -disp as u32;
+ v = disp.unsigned_abs();
} else {
self.f.write_fixed_size("+ 0x")?;
}
@@ -493,7 +493,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T>
let mut v = disp as u32;
if disp < 0 {
self.f.write_fixed_size("- 0x")?;
- v = -disp as u32;
+ v = disp.unsigned_abs();
} else {
self.f.write_fixed_size("+ 0x")?;
}
@@ -533,7 +533,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T>
let mut v = disp as u32;
if disp < 0 {
self.f.write_fixed_size("- 0x")?;
- v = -disp as u32;
+ v = disp.unsigned_abs();
} else {
self.f.write_fixed_size("+ 0x")?;
}
@@ -564,7 +564,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T>
let mut v = disp as u32;
if disp < 0 {
self.f.write_fixed_size("- 0x")?;
- v = -disp as u32;
+ v = disp.unsigned_abs();
} else {
self.f.write_fixed_size("+ 0x")?;
}
@@ -599,7 +599,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T>
let mut v = disp as u32;
if disp < 0 {
self.f.write_fixed_size("- 0x")?;
- v = -disp as u32;
+ v = disp.unsigned_abs();
} else {
self.f.write_fixed_size("+ 0x")?;
}