aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authoriximeow <me@iximeow.net>2019-08-16 02:27:35 -0700
committeriximeow <me@iximeow.net>2020-01-12 16:10:13 -0800
commit3a4e860a626ee03cb4eec4e9a03e5ac5b2e20d75 (patch)
treed16bf6ea36b3e3d52a064c4508157da892bec301 /src
parentc638fb0c342d0284a6a7bff6ecea8302c8cb83ba (diff)
fix panicky negation in debug builds
Diffstat (limited to 'src')
-rw-r--r--src/display.rs2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/display.rs b/src/display.rs
index 7ec7f0f..7d8c1b5 100644
--- a/src/display.rs
+++ b/src/display.rs
@@ -120,7 +120,7 @@ impl <T: std::fmt::Write> Colorize<T> for Operand {
}
&Operand::RegDisp(ref spec, ref disp) => {
let (sign, disp) = if *disp < 0 {
- (true, -*disp)
+ (true, (-std::num::Wrapping(*disp)).0)
} else {
(false, *disp)
};