Skip to content

Commit

Permalink
better instr removing
Browse files Browse the repository at this point in the history
  • Loading branch information
Mizari committed Dec 2, 2023
1 parent 972ba87 commit 9bf64b6
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions herast/tree/ast_patch.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,12 @@ def remove_instr(item:idaapi.cinsn_t, ctx:ASTContext) -> bool:
unused_labels.append(lnum)

removed_labels = collect_labels(item)
for u in unused_labels:
try:
removed_labels.remove(u)
except ValueError:
pass

if len(removed_labels) > 0:
print("[!] failed removing item with labels in it")
return False
Expand Down

0 comments on commit 9bf64b6

Please sign in to comment.