From b3eb8e602963b1b5beeab42c84f9b66e6857f928 Mon Sep 17 00:00:00 2001 From: Bernhard Mueller Date: Mon, 30 Apr 2018 12:27:24 +0700 Subject: [PATCH] Fix reporting crash in on-chain analysis --- mythril/analysis/modules/integer.py | 6 +++--- mythril/analysis/report.py | 4 +++- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/mythril/analysis/modules/integer.py b/mythril/analysis/modules/integer.py index 8cdf2ab0..6e41ae29 100644 --- a/mythril/analysis/modules/integer.py +++ b/mythril/analysis/modules/integer.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) diff --git a/mythril/analysis/report.py b/mythril/analysis/report.py index 61e2e72e..5ad15590 100644 --- a/mythril/analysis/report.py +++ b/mythril/analysis/report.py @@ -92,7 +92,9 @@ class Report: for key, issue in self.issues.items(): if text == "": - text += "# Analysis results for " + issue.filename + if (issue.filename): + text += "# Analysis results for " + issue.filename + text += "\n\n## " + issue.title + "\n\n" text += "- Type: " + issue.type + "\n"