Refactored instructions for extcodehash and its test

pending-opcodes
e-ngo 5 years ago
parent 9dc1007a15
commit 1a0ea91267
  1. 5
      mythril/laser/ethereum/instructions.py

@ -1166,15 +1166,14 @@ class Instruction:
""" """
world_state = global_state.world_state world_state = global_state.world_state
stack = global_state.mstate.stack stack = global_state.mstate.stack
address = stack.pop() address = Extract(159, 0, stack.pop())
if address.symbolic: if address.symbolic:
log.debug("unsupported symbolic address for EXTCODEHASH") log.debug("unsupported symbolic address for EXTCODEHASH")
stack.append(global_state.new_bitvec("extcodehash_" + str(address), 256)) stack.append(global_state.new_bitvec("extcodehash_" + str(address), 256))
return [global_state] return [global_state]
address = address.value address = address.value
mask = int((symbol_factory.BitVecVal(TT256M1, 256) >> 96).value)
address = address & mask
if address not in world_state.accounts: if address not in world_state.accounts:
code_hash = symbol_factory.BitVecVal(0, 256) code_hash = symbol_factory.BitVecVal(0, 256)
else: else:

Loading…
Cancel
Save