Skip to content

Commit

Permalink
chore(interpreter): use already-computed sign in SAR (bluealloy#1147)
Browse files Browse the repository at this point in the history
  • Loading branch information
DaniPopes authored and fubuloubu committed Apr 11, 2024
1 parent 95724fd commit b118185
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/interpreter/src/instructions/bitwise.rs
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ pub fn sar<H: Host, SPEC: Spec>(interpreter: &mut Interpreter, _host: &mut H) {

let value_sign = i256_sign_compl(op2);

*op2 = if *op2 == U256::ZERO || op1 >= U256::from(256) {
*op2 = if value_sign == Sign::Zero || op1 >= U256::from(256) {
match value_sign {
// value is 0 or >=1, pushing 0
Sign::Plus | Sign::Zero => U256::ZERO,
Expand Down

0 comments on commit b118185

Please sign in to comment.