Skip to content

Commit e14740c

Browse files
authored
chore(interpreter): use already-computed sign in SAR (#1147)
1 parent 1bad8cb commit e14740c

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

crates/interpreter/src/instructions/bitwise.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ pub fn sar<H: Host, SPEC: Spec>(interpreter: &mut Interpreter, _host: &mut H) {
103103

104104
let value_sign = i256_sign_compl(op2);
105105

106-
*op2 = if *op2 == U256::ZERO || op1 >= U256::from(256) {
106+
*op2 = if value_sign == Sign::Zero || op1 >= U256::from(256) {
107107
match value_sign {
108108
// value is 0 or >=1, pushing 0
109109
Sign::Plus | Sign::Zero => U256::ZERO,

0 commit comments

Comments
 (0)