Skip to content

Commit

Permalink
Fix hex number literal with underscores parsing (#65)
Browse files Browse the repository at this point in the history
  • Loading branch information
Inphi authored Jun 29, 2023
1 parent ed07912 commit b3e81f6
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/context/exprs/literal.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit b3e81f6

Please sign in to comment.