File tree Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Expand file tree Collapse file tree 1 file changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -1073,12 +1073,6 @@ simplifyNoLitToKeccak e = untilFixpoint (mapExpr go) e
10731073 go (SEx _ (Lit 0 )) = Lit 0
10741074 go (SEx a b) = sex a b
10751075
1076- -- SAR
1077- go (SAR _ (Lit 0 )) = Lit 0
1078- go (SAR _ (Lit x)) | x == maxBound = Lit x
1079- go (SAR (Lit 0 ) b) = b
1080- go (SAR a b) = sar a b
1081-
10821076 -- IsZero
10831077 go (IsZero (IsZero (IsZero a))) = iszero a
10841078 go (IsZero (IsZero (LT x y))) = lt x y
@@ -1219,7 +1213,7 @@ simplifyNoLitToKeccak e = untilFixpoint (mapExpr go) e
12191213
12201214 go (EqByte a b) = eqByte a b
12211215
1222- -- SHL / SHR by 0
1216+ -- SHL / SHR / SAR
12231217 go (SHL a v)
12241218 | a == (Lit 0 ) = v
12251219 | v == (Lit 0 ) = v
@@ -1228,6 +1222,11 @@ simplifyNoLitToKeccak e = untilFixpoint (mapExpr go) e
12281222 | a == (Lit 0 ) = v
12291223 | v == (Lit 0 ) = v
12301224 | otherwise = shr a v
1225+ go (SAR _ (Lit v)) | v == maxBound = Lit v
1226+ go (SAR a v)
1227+ | a == (Lit 0 ) = v
1228+ | v == (Lit 0 ) = v
1229+ | otherwise = sar a v
12311230
12321231 -- Bitwise AND & OR. These MUST preserve bitwise equivalence
12331232 go (And a b)
You can’t perform that action at this time.
0 commit comments