Mercurial > repos > blastem
diff m68k_core.c @ 1341:f1607874dbee
Fix intermittent crash due to an inadvertent executable memory allocation in m68k instruction retranslation
author | Michael Pavone <pavone@retrodev.com> |
---|---|
date | Thu, 04 May 2017 21:06:35 -0700 |
parents | 85a90964b557 |
children | df6af7187b36 |
line wrap: on
line diff
--- a/m68k_core.c Thu May 04 21:00:25 2017 -0700 +++ b/m68k_core.c Thu May 04 21:06:35 2017 -0700 @@ -1095,10 +1095,12 @@ 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; }