Skip to content

Commit

Permalink
Shift operands were swapped in accepted EIP145
Browse files Browse the repository at this point in the history
  • Loading branch information
axic committed Apr 9, 2018
1 parent b2c2ed7 commit da9b6ac
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions libevmasm/RuleList.h
Original file line number Diff line number Diff line change
Expand Up @@ -90,14 +90,14 @@ std::vector<SimplificationRule<Pattern>> simplificationRuleList(
return u256(boost::multiprecision::bit_test(B.d(), testBit) ? B.d() | ~mask : B.d() & mask);
}, false},
{{Instruction::SHL, {A, B}}, [=]{
if (B.d() > 255)
if (A.d() > 255)
return u256(0);
return u256(bigint(A.d()) << unsigned(B.d()));
return u256(bigint(B.d()) << unsigned(A.d()));
}},
{{Instruction::SHR, {A, B}}, [=]{
if (B.d() > 255)
if (A.d() > 255)
return u256(0);
return A.d() >> unsigned(B.d());
return B.d() >> unsigned(A.d());
}},

// invariants involving known constants
Expand Down

0 comments on commit da9b6ac

Please sign in to comment.