Merge pull request #648 from hzzhang/hzzhang/fix-bvmul-overflow-check

analysis/integer: fix the overflow check of bit vector multiplication
pull/656/head
Nikhil Parasaram 6 years ago committed by GitHub
commit e6f7423368
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 3
      mythril/analysis/modules/integer.py
  2. 2
      requirements.txt
  3. 2
      setup.py

@ -72,11 +72,12 @@ def _check_integer_overflow(statespace, state, node):
# Formulate expression # Formulate expression
if instruction["opcode"] == "ADD": if instruction["opcode"] == "ADD":
expr = op0 + op1 expr = op0 + op1
constraint = Not(BVAddNoOverflow(op0, op1, signed=False))
else: else:
expr = op1 * op0 expr = op1 * op0
constraint = Not(BVMulNoOverflow(op0, op1, signed=False))
# Check satisfiable # Check satisfiable
constraint = Or(And(ULT(expr, op0), op1 != 0), And(ULT(expr, op1), op0 != 0))
model = _try_constraints(node.constraints, [constraint]) model = _try_constraints(node.constraints, [constraint])
if model is None: if model is None:

@ -24,5 +24,5 @@ pytest_mock
requests requests
rlp>=1.0.1 rlp>=1.0.1
transaction>=2.2.1 transaction>=2.2.1
z3-solver>=4.5 z3-solver>=4.8
pysha3 pysha3

@ -75,7 +75,7 @@ setup(
install_requires=[ install_requires=[
"coloredlogs>=10.0", "coloredlogs>=10.0",
"ethereum>=2.3.2", "ethereum>=2.3.2",
"z3-solver>=4.5", "z3-solver>=4.8",
"requests", "requests",
"py-solc", "py-solc",
"plyvel", "plyvel",

Loading…
Cancel
Save