From 135de8d94e30aa3c91b002a60f8e1bd4fe843459 Mon Sep 17 00:00:00 2001 From: Peilin Zheng Date: Sun, 29 Aug 2021 20:19:47 +0800 Subject: [PATCH] Fix bug during checking potential issues (#1507) * Fix bug due to list.remove() in a loop --- mythril/analysis/potential_issues.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/mythril/analysis/potential_issues.py b/mythril/analysis/potential_issues.py index 6d9159b8..51be9799 100644 --- a/mythril/analysis/potential_issues.py +++ b/mythril/analysis/potential_issues.py @@ -81,15 +81,16 @@ def check_potential_issues(state: GlobalState) -> None: :return: """ annotation = get_potential_issues_annotation(state) + unsat_potential_issues = [] for potential_issue in annotation.potential_issues: try: transaction_sequence = get_transaction_sequence( state, state.world_state.constraints + potential_issue.constraints ) except UnsatError: + unsat_potential_issues.append(potential_issue) continue - annotation.potential_issues.remove(potential_issue) potential_issue.detector.cache.add(potential_issue.address) potential_issue.detector.issues.append( Issue( @@ -106,3 +107,4 @@ def check_potential_issues(state: GlobalState) -> None: transaction_sequence=transaction_sequence, ) ) + annotation.potential_issues = unsat_potential_issues