diff options
author | Michael Pavone <pavone@retrodev.com> | 2015-05-25 15:01:38 -0700 |
---|---|---|
committer | Michael Pavone <pavone@retrodev.com> | 2015-05-25 15:01:38 -0700 |
commit | b40138532a2345f01538a991ab756fa5e28aa8e0 (patch) | |
tree | ddae8eaa92c6eafa115bd96ea401b7f84e1fda40 /m68k_core_x86.c | |
parent | f76857783001f197067e6a8728e76046da8b9e6f (diff) |
Fix crash bug in 32-bit build for certain secnarios with bcd instructions
Diffstat (limited to 'm68k_core_x86.c')
-rw-r--r-- | m68k_core_x86.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/m68k_core_x86.c b/m68k_core_x86.c index ed0265b..7b542da 100644 --- a/m68k_core_x86.c +++ b/m68k_core_x86.c @@ -1451,8 +1451,10 @@ void translate_m68k_abcd_sbcd(m68k_options *opts, m68kinst *inst, host_ea *src_o cmp_ir(code, 0, opts->gen.scratch1, SZ_B); set_flag_cond(opts, CC_S, FLAG_N); - jcc(code, CC_Z, code->cur + 4); + code_ptr no_setz = code->cur+1; + jcc(code, CC_Z, no_setz); set_flag(opts, 0, FLAG_Z); + *no_setz = code->cur - (no_setz + 1); if (dst_op->base != opts->gen.scratch1) { if (dst_op->mode == MODE_REG_DIRECT) { mov_rr(code, opts->gen.scratch1, dst_op->base, SZ_B); |