changeset 1107:fc125af5e4f1

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
author Michael Pavone <pavone@retrodev.com>
date Mon, 12 Dec 2016 19:21:22 -0800
parents cacbd3f18f03
children 87114df913ec
files backend_x86.c
diffstat 1 files changed, 1 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/backend_x86.c	Mon Dec 12 09:50:33 2016 -0800
+++ b/backend_x86.c	Mon Dec 12 19:21:22 2016 -0800
@@ -231,7 +231,7 @@
 				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);