Commit b6d7c3db authored by ths's avatar ths
Browse files

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
parent e034e2c3
...@@ -5327,8 +5327,12 @@ static target_ulong disas_insn(DisasContext *s, target_ulong pc_start) ...@@ -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))
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment