From dcdceefd5d0f6976236f6a77056e10186b9e6e56 Mon Sep 17 00:00:00 2001 From: palkeo Date: Mon, 12 Aug 2019 23:17:50 +0200 Subject: [PATCH] Fix support for calls forwarding the entire calldata. (#1195) * Fix support for calls forwarding the entire calldata. * Reformat with black. * uses_entire_calldata is always a Bool * Revert "uses_entire_calldata is always a Bool" This reverts commit 629cb531722cb73661353ccc2a1eb64af0c857d7. * Revert "Revert "uses_entire_calldata is always a Bool"" Didn't help, it passed before. Strange. Will need to find a way to investigate locally. --- mythril/laser/ethereum/call.py | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/mythril/laser/ethereum/call.py b/mythril/laser/ethereum/call.py index 2e471037..bc1c360c 100644 --- a/mythril/laser/ethereum/call.py +++ b/mythril/laser/ethereum/call.py @@ -16,7 +16,7 @@ from mythril.laser.ethereum.state.calldata import ( ConcreteCalldata, ) from mythril.laser.ethereum.state.global_state import GlobalState -from mythril.laser.smt import BitVec +from mythril.laser.smt import BitVec, Bool, is_true from mythril.laser.smt import simplify, Expression, symbol_factory from mythril.support.loader import DynLoader @@ -197,10 +197,10 @@ def get_call_data( ) uses_entire_calldata = simplify( - memory_size - global_state.environment.calldata.calldatasize == 0 + memory_size == global_state.environment.calldata.calldatasize ) - if uses_entire_calldata is True: + if is_true(uses_entire_calldata): return global_state.environment.calldata try: @@ -211,7 +211,9 @@ def get_call_data( ] return ConcreteCalldata(transaction_id, calldata_from_mem) except TypeError: - log.debug("Unsupported symbolic calldata offset") + log.debug( + "Unsupported symbolic calldata offset %s size %s", memory_start, memory_size + ) return SymbolicCalldata(transaction_id)