Skip to content

Commit

Permalink
Merge pull request #1641 from crytic/divide-before-multiply-todo
Browse files Browse the repository at this point in the history
consider constants in divide-before-multiply
  • Loading branch information
montyly authored Feb 14, 2023
2 parents 023464e + 4e8066c commit fa2889d
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions slither/detectors/statements/divide_before_multiply.py
Original file line number Diff line number Diff line change
Expand Up @@ -64,8 +64,7 @@ def _explore(to_explore, f_results, divisions): # pylint: disable=too-many-bran
node_results = []

for ir in node.irs:
# check for Constant, has its not hashable (TODO: make Constant hashable)
if isinstance(ir, Assignment) and not isinstance(ir.rvalue, Constant):
if isinstance(ir, Assignment):
if ir.rvalue in divisions:
# Avoid dupplicate. We dont use set so we keep the order of the nodes
if node not in divisions[ir.rvalue]:
Expand Down

0 comments on commit fa2889d

Please sign in to comment.