changeset 733:fbda8e865dae

Fix crash bug in 32-bit build for certain secnarios with bcd instructions
author Michael Pavone <pavone@retrodev.com>
date Mon, 25 May 2015 15:01:38 -0700
parents 61467483eb31
children e21c274a008e
files m68k_core_x86.c
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/m68k_core_x86.c	Mon May 25 13:21:24 2015 -0700
+++ b/m68k_core_x86.c	Mon May 25 15:01:38 2015 -0700
@@ -1451,8 +1451,10 @@
 
 	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);