From 54e71ce54fe55606ab62d7db53ab8f63f2514ca3 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Mon, 12 Dec 2016 19:21:22 -0800 Subject: Fix to the fix of handling of self modifying code. Was ORing the base address with the wrong register before calling the modified code handler --- backend_x86.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'backend_x86.c') diff --git a/backend_x86.c b/backend_x86.c index a93a273..fcf01cd 100644 --- a/backend_x86.c +++ b/backend_x86.c @@ -231,7 +231,7 @@ code_ptr gen_mem_fun(cpu_options * opts, memmap_chunk const * memmap, uint32_t n code_ptr not_code = code->cur + 1; jcc(code, CC_NC, code->cur + 2); if (memmap[chunk].mask != opts->address_mask) { - or_ir(code, memmap[chunk].start, opts->scratch1, opts->address_size); + or_ir(code, memmap[chunk].start, opts->scratch2, opts->address_size); } call(code, opts->save_context); call_args(code, opts->handle_code_write, 2, opts->scratch2, opts->context_reg); -- cgit v1.2.3