Fix bug during checking potential issues (#1507)

* Fix bug due to list.remove() in a loop
pull/1511/head
Peilin Zheng 3 years ago committed by GitHub
parent 5b3336a7f7
commit 135de8d94e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 4
      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

Loading…
Cancel
Save