Fix division by zero handling, by Joris van Rantwijk.

git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@3012 c046a42c-6fe2-441c-8c8c-71466251a162
This commit is contained in:
ths 2007-06-23 18:21:26 +00:00
parent e034e2c39a
commit b6d7c3db4f

View File

@ -5327,8 +5327,12 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start)
if (CODE64(s)) if (CODE64(s))
goto illegal_op; goto illegal_op;
val = ldub_code(s->pc++); val = ldub_code(s->pc++);
gen_op_aam(val); if (val == 0) {
s->cc_op = CC_OP_LOGICB; gen_exception(s, EXCP00_DIVZ, pc_start - s->cs_base);
} else {
gen_op_aam(val);
s->cc_op = CC_OP_LOGICB;
}
break; break;
case 0xd5: /* aad */ case 0xd5: /* aad */
if (CODE64(s)) if (CODE64(s))