diff options
author | iximeow <me@iximeow.net> | 2024-06-23 15:34:03 -0700 |
---|---|---|
committer | iximeow <me@iximeow.net> | 2024-06-23 15:34:03 -0700 |
commit | 24d5384f610ae33439a73493e6ed3c842ef852a0 (patch) | |
tree | b3c0a8bcb1dca09bdcc50fa67dc3cb77d07c12f7 | |
parent | 1fdd243276d7184bbc0acb0bda349283cf8cfbda (diff) |
another fuzz bug
-rw-r--r-- | src/long_mode/display.rs | 12 | ||||
-rw-r--r-- | src/protected_mode/display.rs | 10 | ||||
-rw-r--r-- | src/real_mode/display.rs | 10 |
3 files changed, 16 insertions, 16 deletions
diff --git a/src/long_mode/display.rs b/src/long_mode/display.rs index 37f832a..907ee9c 100644 --- a/src/long_mode/display.rs +++ b/src/long_mode/display.rs @@ -296,7 +296,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u8; if imm < 0 { self.f.write_char('-')?; - v = -imm as u8; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u8(v)?; @@ -317,7 +317,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u16; if imm < 0 { self.f.write_char('-')?; - v = -imm as u16; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u16(v)?; @@ -337,7 +337,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u32; if imm < 0 { self.f.write_char('-')?; - v = -imm as u32; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u32(v)?; @@ -358,7 +358,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u64; if imm < 0 { self.f.write_char('-')?; - v = -imm as u64; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u64(v)?; @@ -4287,7 +4287,7 @@ impl<'a, F: DisplaySink> super::OperandVisitor for RelativeBranchPrinter<'a, F> if rel < 0 { self.out.write_char('-')?; //danger_anguished_string_write(&mut self.out, "-"); - v = -rel as u8; + v = rel.unsigned_abs(); } else { self.out.write_char('+')?; // danger_anguished_string_write(&mut self.out, "+"); @@ -4308,7 +4308,7 @@ impl<'a, F: DisplaySink> super::OperandVisitor for RelativeBranchPrinter<'a, F> if rel < 0 { self.out.write_char('-')?; // danger_anguished_string_write(&mut self.out, "-"); - v = -rel as u32; + v = rel.unsigned_abs(); } else { self.out.write_char('+')?; // danger_anguished_string_write(&mut self.out, "+"); diff --git a/src/protected_mode/display.rs b/src/protected_mode/display.rs index bdc0e95..349e5c1 100644 --- a/src/protected_mode/display.rs +++ b/src/protected_mode/display.rs @@ -293,7 +293,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u8; if imm < 0 { self.f.write_char('-')?; - v = -imm as u8; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u8(v)?; @@ -314,7 +314,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u16; if imm < 0 { self.f.write_char('-')?; - v = -imm as u16; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u16(v)?; @@ -334,7 +334,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u32; if imm < 0 { self.f.write_char('-')?; - v = -imm as u32; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u32(v)?; @@ -2839,7 +2839,7 @@ impl<'a, F: DisplaySink> super::OperandVisitor for RelativeBranchPrinter<'a, F> if rel < 0 { self.out.write_char('-')?; //danger_anguished_string_write(&mut self.out, "-"); - v = -rel as u8; + v = rel.unsigned_abs(); } else { self.out.write_char('+')?; // danger_anguished_string_write(&mut self.out, "+"); @@ -2860,7 +2860,7 @@ impl<'a, F: DisplaySink> super::OperandVisitor for RelativeBranchPrinter<'a, F> if rel < 0 { self.out.write_char('-')?; // danger_anguished_string_write(&mut self.out, "-"); - v = -rel as u32; + v = rel.unsigned_abs(); } else { self.out.write_char('+')?; // danger_anguished_string_write(&mut self.out, "+"); diff --git a/src/real_mode/display.rs b/src/real_mode/display.rs index 8de8168..fe68830 100644 --- a/src/real_mode/display.rs +++ b/src/real_mode/display.rs @@ -293,7 +293,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u8; if imm < 0 { self.f.write_char('-')?; - v = -imm as u8; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u8(v)?; @@ -314,7 +314,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u16; if imm < 0 { self.f.write_char('-')?; - v = -imm as u16; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u16(v)?; @@ -334,7 +334,7 @@ impl <T: DisplaySink> super::OperandVisitor for DisplayingOperandVisitor<'_, T> let mut v = imm as u32; if imm < 0 { self.f.write_char('-')?; - v = -imm as u32; + v = imm.unsigned_abs(); } self.f.write_fixed_size("0x")?; self.f.write_u32(v)?; @@ -2839,7 +2839,7 @@ impl<'a, F: DisplaySink> super::OperandVisitor for RelativeBranchPrinter<'a, F> if rel < 0 { self.out.write_char('-')?; //danger_anguished_string_write(&mut self.out, "-"); - v = -rel as u8; + v = rel.unsigned_abs(); } else { self.out.write_char('+')?; // danger_anguished_string_write(&mut self.out, "+"); @@ -2860,7 +2860,7 @@ impl<'a, F: DisplaySink> super::OperandVisitor for RelativeBranchPrinter<'a, F> if rel < 0 { self.out.write_char('-')?; // danger_anguished_string_write(&mut self.out, "-"); - v = -rel as u32; + v = rel.unsigned_abs(); } else { self.out.write_char('+')?; // danger_anguished_string_write(&mut self.out, "+"); |