Merge pull request #339 from norhh/sha_fix

check for z3 before simplify
pull/343/head
Nikhil Parasaram 6 years ago committed by GitHub
commit a78faeb0f5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 6
      mythril/laser/ethereum/instructions.py

@ -5,7 +5,7 @@ from copy import copy, deepcopy
import ethereum.opcodes as opcodes import ethereum.opcodes as opcodes
from ethereum import utils from ethereum import utils
from z3 import BitVec, Extract, UDiv, simplify, Concat, ULT, UGT, BitVecNumRef, Not, \ from z3 import BitVec, Extract, UDiv, simplify, Concat, ULT, UGT, BitVecNumRef, Not, \
is_false is_false, is_expr
from z3 import BitVecVal, If, BoolRef from z3 import BitVecVal, If, BoolRef
import mythril.laser.ethereum.util as helper import mythril.laser.ethereum.util as helper
@ -481,7 +481,9 @@ class Instruction:
# FIXME: broad exception catch # FIXME: broad exception catch
except: except:
# Can't access symbolic memory offsets # Can't access symbolic memory offsets
state.stack.append(BitVec("KECCAC_mem[" + str(simplify(op0)) + "]", 256)) if is_expr(op0):
op0 = simplify(op0)
state.stack.append(BitVec("KECCAC_mem[" + str(op0) + "]", 256))
return [global_state] return [global_state]
try: try:

Loading…
Cancel
Save