From b3e81f6a36e48461cbfd76f7c8294921dccc3aeb Mon Sep 17 00:00:00 2001 From: Inphi Date: Thu, 29 Jun 2023 13:07:14 -0400 Subject: [PATCH] Fix hex number literal with underscores parsing (#65) --- src/context/exprs/literal.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/context/exprs/literal.rs b/src/context/exprs/literal.rs index 3d07a3e0..ec8c4b8f 100644 --- a/src/context/exprs/literal.rs +++ b/src/context/exprs/literal.rs @@ -111,7 +111,8 @@ pub trait Literal: AnalyzerLike + Sized { integer: &str, negative: bool, ) -> Result<(), ExprErr> { - let val = U256::from_str_radix(integer, 16).unwrap(); + let integer: String = integer.chars().filter(|c| *c != '_').collect(); + let val = U256::from_str_radix(&integer, 16).unwrap(); let size: u16 = ((32 - (val.leading_zeros() / 8)) * 8) as u16; let concrete_node = if negative { let val = I256::from(-1i32) * I256::from_raw(val);