Skip to content

Commit

Permalink
Corrected dirty handler error msg and logic
Browse files Browse the repository at this point in the history
  • Loading branch information
EvelynVusky committed Aug 8, 2023
1 parent f49fa94 commit b22bdfe
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
7 changes: 4 additions & 3 deletions angr/analyses/propagator/engine_vex.py
Original file line number Diff line number Diff line change
Expand Up @@ -123,15 +123,16 @@ def _handle_function(self, addr):
# VEX statement handlers
#
def _handle_Dirty(self, stmt):
# For RISCV CSR and mret operations, the Dirty statement is skipped.
if (archinfo.arch_riscv64.is_riscv_arch(self.project.arch)):
helper = str(stmt.cee)
if helper not in ("riscv_dirtyhelper_CSR_rw",
if helper in ("riscv_dirtyhelper_CSR_rw",
"riscv_dirtyhelper_CSR_s",
"riscv_dirtyhelper_CSR_c",
"riscv_dirtyhelper_mret"):
super()._handle_Dirty(stmt)
else:
pass
else:
super()._handle_Dirty(stmt)

def _handle_WrTmp(self, stmt):
super()._handle_WrTmp(stmt)
Expand Down
2 changes: 1 addition & 1 deletion angr/engines/light/engine.py
Original file line number Diff line number Diff line change
Expand Up @@ -210,7 +210,7 @@ def _handle_WrTmpData(self, tmp, data):
self.tmps[tmp] = data

def _handle_Dirty(self, stmt):
raise NotImplementedError("Please implement the Put handler with your own logic.")
raise NotImplementedError("Please implement the Dirty handler with your own logic.")

def _handle_Put(self, stmt):
raise NotImplementedError("Please implement the Put handler with your own logic.")
Expand Down

0 comments on commit b22bdfe

Please sign in to comment.