Backport 10b8eb94c0
target/i386: Verify memory operand for lcall and ljmp These two opcodes only allow a memory operand. Lacking the check for a register operand, we used the A0 temp without initialization, which led to a tcg abort.
This commit is contained in:
parent
75676eb0cd
commit
a7a5d187e7
@ -5476,6 +5476,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
|
||||
gen_jr(s, s->T0);
|
||||
break;
|
||||
case 3: /* lcall Ev */
|
||||
if (mod == 3) {
|
||||
goto illegal_op;
|
||||
}
|
||||
gen_op_ld_v(s, ot, s->T1, s->A0);
|
||||
gen_add_A0_im(s, 1 << ot);
|
||||
gen_op_ld_v(s, MO_16, s->T0, s->A0);
|
||||
@ -5503,6 +5506,9 @@ static target_ulong disas_insn(DisasContext *s, CPUState *cpu)
|
||||
gen_jr(s, s->T0);
|
||||
break;
|
||||
case 5: /* ljmp Ev */
|
||||
if (mod == 3) {
|
||||
goto illegal_op;
|
||||
}
|
||||
gen_op_ld_v(s, ot, s->T1, s->A0);
|
||||
gen_add_A0_im(s, 1 << ot);
|
||||
gen_op_ld_v(s, MO_16, s->T0, s->A0);
|
||||
|
Loading…
Reference in New Issue
Block a user