Exception handling fix

pull/646/head
Nikhil Parasaram 6 years ago
parent 3aeaf59bea
commit a8f6c477c8
  1. 4
      mythril/laser/ethereum/call.py
  2. 4
      mythril/laser/ethereum/instructions.py

@ -123,8 +123,8 @@ def get_callee_account(global_state, callee_address, dynamic_loader):
try: try:
code = dynamic_loader.dynld(environment.active_account.address, callee_address) code = dynamic_loader.dynld(environment.active_account.address, callee_address)
except ValueError as error: except ValueError as error:
logging.debug("Unable to execute dynamic loader because: {}".format(error.message)) logging.debug("Unable to execute dynamic loader because: {}".format(str(error)))
raise ValueError(error.message) raise ValueError(str(error))
if code is None: if code is None:
logging.debug("No code returned, not a contract account?") logging.debug("No code returned, not a contract account?")
raise ValueError() raise ValueError()

@ -701,8 +701,8 @@ class Instruction:
try: try:
code = self.dynamic_loader.dynld(environment.active_account.address, addr) code = self.dynamic_loader.dynld(environment.active_account.address, addr)
except ValueError as e: except (ValueError, AttributeError) as e:
logging.info("error accessing contract storage due to: " + str(e.message)) logging.info("error accessing contract storage due to: " + str(e))
state.stack.append(global_state.new_bitvec("extcodesize_" + str(addr), 256)) state.stack.append(global_state.new_bitvec("extcodesize_" + str(addr), 256))
return [global_state] return [global_state]

Loading…
Cancel
Save