Skip to content

Commit

Permalink
Use get_code_addr in hook_add to avoid spurious failures if the page …
Browse files Browse the repository at this point in the history
…is read-only
  • Loading branch information
ergo720 committed Dec 8, 2023
1 parent 6969c50 commit cc13513
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions lib86cpu/interface.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1144,8 +1144,7 @@ hook_add(cpu_t *cpu, addr_t addr, hook_t hook_addr)
// of the translation of a new code block)

try {
bool is_code;
addr_t phys_addr = get_write_addr(cpu, addr, 2, cpu->cpu_ctx.regs.eip, &is_code);
addr_t phys_addr = get_code_addr(cpu, addr, cpu->cpu_ctx.regs.eip);
tc_invalidate(&cpu->cpu_ctx, phys_addr, 1, cpu->cpu_ctx.regs.eip);
}
catch (host_exp_t type) {
Expand Down

0 comments on commit cc13513

Please sign in to comment.