Skip to content

Commit

Permalink
fix: resolving address alias for infeasible paths (#195)
Browse files Browse the repository at this point in the history
  • Loading branch information
daejunpark authored Sep 19, 2023
1 parent 59ebac8 commit c13095d
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions src/halmos/sevm.py
Original file line number Diff line number Diff line change
Expand Up @@ -1524,17 +1524,13 @@ def resolve_address_alias(self, ex: Exec, target: Address) -> Address:

if target not in ex.alias:
for addr in ex.code:
if (
# must equal
ex.check(target != addr) == unsat
# ensure existing path condition is feasible
and ex.check(target == addr) != unsat
):
if ex.check(target != addr) == unsat: # target == addr
if self.options.get("debug"):
print(
f"[DEBUG] Address alias: {hexify(addr)} for {hexify(target)}"
)
ex.alias[target] = addr
ex.solver.add(target == addr)
break

return ex.alias.get(target)
Expand Down

0 comments on commit c13095d

Please sign in to comment.