From 88f286ec0fe45cc08fb801cb609faa1a808c9be9 Mon Sep 17 00:00:00 2001 From: Michael Pavone Date: Thu, 4 May 2017 21:06:35 -0700 Subject: Fix intermittent crash due to an inadvertent executable memory allocation in m68k instruction retranslation --- m68k_core.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'm68k_core.c') diff --git a/m68k_core.c b/m68k_core.c index a3a3c32..1faa3c0 100644 --- a/m68k_core.c +++ b/m68k_core.c @@ -1095,10 +1095,12 @@ void * m68k_retranslate_inst(uint32_t address, m68k_context * context) code_ptr native_end = code->cur; code->cur = native_start + MAX_NATIVE_SIZE; code_ptr rest = get_native_address_trans(context, orig + (after-inst)*2); - code_ptr tmp = code->cur; - code->cur = native_end; - jmp(code, rest); - code->cur = tmp; + code_info tmp_code = { + .cur = native_end, + .last = native_start + MAX_NATIVE_SIZE, + .stack_off = code->stack_off + }; + jmp(&tmp_code, rest); } else { code->cur = native_start + MAX_NATIVE_SIZE; } -- cgit v1.2.3