From f2145702c9c12daaad106b63d268bd1764a8e603 Mon Sep 17 00:00:00 2001 From: Aki Date: Tue, 12 Sep 2023 15:01:07 +0200 Subject: [PATCH] Fix cast to I256 from min signed type --- crates/ir/src/bigint.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/ir/src/bigint.rs b/crates/ir/src/bigint.rs index f6dbc0a5..f6b8f587 100644 --- a/crates/ir/src/bigint.rs +++ b/crates/ir/src/bigint.rs @@ -242,7 +242,7 @@ macro_rules! impl_from { } else if val == <$ty>::MIN { Self { is_negative: true, - abs: U256::one() << std::mem::size_of::<$ty>() * 8, + abs: U256::one() << std::mem::size_of::<$ty>() * 8 - 1, } } else { Self {