Merge pull request #664 from mir-protocol/fix_shift_propagation

Fix shift order in constant propagation
This commit is contained in:
Daniel Lubarov 2022-08-11 12:57:22 -04:00 committed by GitHub
commit cf0de26ddf
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -53,8 +53,8 @@ fn constant_propagation(code: &mut Vec<Item>) {
"DIV" => Some(x.checked_div(y).unwrap_or(U256::zero())),
"MOD" => Some(x.checked_rem(y).unwrap_or(U256::zero())),
"EXP" => Some(x.overflowing_pow(y).0),
"SHL" => Some(x << y),
"SHR" => Some(x >> y),
"SHL" => Some(y << x),
"SHR" => Some(y >> x),
"AND" => Some(x & y),
"OR" => Some(x | y),
"XOR" => Some(x ^ y),