Fix reporting crash in on-chain analysis

pull/163/merge
Bernhard Mueller 7 years ago
parent 42a86ff966
commit b3eb8e6029
  1. 6
      mythril/analysis/modules/integer.py
  2. 2
      mythril/analysis/report.py

@ -184,7 +184,7 @@ def _check_integer_underflow(statespace, state, node):
# If we get to this point then there has been an integer overflow
# Find out if the overflowed value is actually used
interesting_usages = _search_children(statespace, node, (op0 - op1), index=node.states.index(state))
logging.info(interesting_usages)
logging.debug(interesting_usages)
# Stop if it isn't
if len(interesting_usages) == 0:
@ -232,7 +232,7 @@ def _check_taint(statement, expression):
def _check_jumpi(state, expression):
""" Check if conditional jump is dependent on the result of expression"""
logging.info(state.get_current_instruction()['opcode'])
logging.debug(state.get_current_instruction()['opcode'])
assert state.get_current_instruction()['opcode'] == 'JUMPI'
condition = state.mstate.stack[-2]
return _check_taint(condition, expression)
@ -240,7 +240,7 @@ def _check_jumpi(state, expression):
def _check_sstore(state, expression):
""" Check if store operation is dependent on the result of expression"""
logging.info(state.get_current_instruction()['opcode'])
logging.debug(state.get_current_instruction()['opcode'])
assert state.get_current_instruction()['opcode'] == 'SSTORE'
value = state.mstate.stack[-2]
return _check_taint(value, expression)

@ -92,7 +92,9 @@ class Report:
for key, issue in self.issues.items():
if text == "":
if (issue.filename):
text += "# Analysis results for " + issue.filename
text += "\n\n## " + issue.title + "\n\n"
text += "- Type: " + issue.type + "\n"

Loading…
Cancel
Save