Fix control flow bug in external calls module

pull/88/head
Bernhard Mueller 7 years ago
parent 11fa58a92e
commit 4f111ae786
  1. 1
      mythril/analysis/modules/external_calls.py
  2. 10
      mythril/analysis/symbolic.py

@ -56,7 +56,6 @@ def execute(statespace):
"an address found at storage slot " + str(index) + ". " + \
"This storage slot can be written to by calling the function '" + func + "'. "
user_supplied = True
break
if user_supplied:

@ -41,15 +41,17 @@ class SymExecWrapper:
if op in ('CALL', 'CALLCODE', 'DELEGATECALL', 'STATICCALL'):
stack = copy.deepcopy(state.mstate.stack)
logging.debug("CALL ANALYSIS: CALL AT %d" % (instruction['address']))
stack = state.mstate.stack
if op in ('CALL', 'CALLCODE'):
gas, to, value, meminstart, meminsz, memoutstart, memoutsz = \
get_variable(stack[-1]), get_variable(stack[-2]), get_variable(stack[-3]), get_variable(stack[-4]), get_variable(stack[-5]), get_variable(stack[-6]), get_variable(stack[-7])
# get_variable(stack.pop()), get_variable(stack.pop()), get_variable(stack.pop()), get_variable(stack.pop()), get_variable(stack.pop()), get_variable(stack.pop()), get_variable(stack.pop())
if (to.type == VarType.CONCRETE):
if (to.val < 5):
logging.debug("TO: " + str(to))
if to.type == VarType.CONCRETE and to.val < 5:
# ignore prebuilts
continue

Loading…
Cancel
Save