aboutsummaryrefslogtreecommitdiffstats
path: root/libevmasm/RuleList.h
diff options
context:
space:
mode:
authorchriseth <chris@ethereum.org>2018-04-17 05:03:49 +0800
committerGitHub <noreply@github.com>2018-04-17 05:03:49 +0800
commit4cb486ee993cadde5564fb6c611d2bcf4fc44414 (patch)
tree6b971913021037cf28141c38af97c7ecda77719f /libevmasm/RuleList.h
parentdfe3193c7382c80f1814247a162663a97c3f5e67 (diff)
parentb8431c5c4a6795db8c42a1a3389047658bb87301 (diff)
downloaddexon-solidity-4cb486ee993cadde5564fb6c611d2bcf4fc44414.tar
dexon-solidity-4cb486ee993cadde5564fb6c611d2bcf4fc44414.tar.gz
dexon-solidity-4cb486ee993cadde5564fb6c611d2bcf4fc44414.tar.bz2
dexon-solidity-4cb486ee993cadde5564fb6c611d2bcf4fc44414.tar.lz
dexon-solidity-4cb486ee993cadde5564fb6c611d2bcf4fc44414.tar.xz
dexon-solidity-4cb486ee993cadde5564fb6c611d2bcf4fc44414.tar.zst
dexon-solidity-4cb486ee993cadde5564fb6c611d2bcf4fc44414.zip
Merge pull request #3892 from ethereum/develop
Merge develop into release for 0.4.22
Diffstat (limited to 'libevmasm/RuleList.h')
-rw-r--r--libevmasm/RuleList.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/libevmasm/RuleList.h b/libevmasm/RuleList.h
index da522cec..abcf170c 100644
--- a/libevmasm/RuleList.h
+++ b/libevmasm/RuleList.h
@@ -89,6 +89,16 @@ std::vector<SimplificationRule<Pattern>> simplificationRuleList(
u256 mask = (u256(1) << testBit) - 1;
return u256(boost::multiprecision::bit_test(B.d(), testBit) ? B.d() | ~mask : B.d() & mask);
}, false},
+ {{Instruction::SHL, {A, B}}, [=]{
+ if (A.d() > 255)
+ return u256(0);
+ return u256(bigint(B.d()) << unsigned(A.d()));
+ }, false},
+ {{Instruction::SHR, {A, B}}, [=]{
+ if (A.d() > 255)
+ return u256(0);
+ return B.d() >> unsigned(A.d());
+ }, false},
// invariants involving known constants
{{Instruction::ADD, {X, 0}}, [=]{ return X; }, false},