From a8f6c477c871d29fb8dbdbab657516cfc40e69ca Mon Sep 17 00:00:00 2001 From: Nikhil Parasaram Date: Wed, 31 Oct 2018 00:23:28 +0530 Subject: [PATCH] Exception handling fix --- mythril/laser/ethereum/call.py | 4 ++-- mythril/laser/ethereum/instructions.py | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/mythril/laser/ethereum/call.py b/mythril/laser/ethereum/call.py index b64b5ed6..55066aac 100644 --- a/mythril/laser/ethereum/call.py +++ b/mythril/laser/ethereum/call.py @@ -123,8 +123,8 @@ def get_callee_account(global_state, callee_address, dynamic_loader): try: code = dynamic_loader.dynld(environment.active_account.address, callee_address) except ValueError as error: - logging.debug("Unable to execute dynamic loader because: {}".format(error.message)) - raise ValueError(error.message) + logging.debug("Unable to execute dynamic loader because: {}".format(str(error))) + raise ValueError(str(error)) if code is None: logging.debug("No code returned, not a contract account?") raise ValueError() diff --git a/mythril/laser/ethereum/instructions.py b/mythril/laser/ethereum/instructions.py index 75dfada0..96b19609 100644 --- a/mythril/laser/ethereum/instructions.py +++ b/mythril/laser/ethereum/instructions.py @@ -701,8 +701,8 @@ class Instruction: try: code = self.dynamic_loader.dynld(environment.active_account.address, addr) - except ValueError as e: - logging.info("error accessing contract storage due to: " + str(e.message)) + except (ValueError, AttributeError) as e: + logging.info("error accessing contract storage due to: " + str(e)) state.stack.append(global_state.new_bitvec("extcodesize_" + str(addr), 256)) return [global_state]