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 629cb53172.

* 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.
standard_actors
palkeo 5 years ago committed by Nikhil Parasaram
parent 7a025fadee
commit dcdceefd5d
  1. 10
      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)

Loading…
Cancel
Save