Commit 3a1d9b8bbb693d18a346552a5e98c96ad5006ff9
1 parent
0e4b179d
fixed lea exception
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@622 c046a42c-6fe2-441c-8c8c-71466251a162
Showing
1 changed file
with
4 additions
and
2 deletions
target-i386/translate.c
... | ... | @@ -2554,6 +2554,9 @@ static uint8_t *disas_insn(DisasContext *s, uint8_t *pc_start) |
2554 | 2554 | case 0x8d: /* lea */ |
2555 | 2555 | ot = dflag ? OT_LONG : OT_WORD; |
2556 | 2556 | modrm = ldub_code(s->pc++); |
2557 | + mod = (modrm >> 6) & 3; | |
2558 | + if (mod == 3) | |
2559 | + goto illegal_op; | |
2557 | 2560 | reg = (modrm >> 3) & 7; |
2558 | 2561 | /* we must ensure that no segment is added */ |
2559 | 2562 | s->override = -1; |
... | ... | @@ -2815,7 +2818,6 @@ static uint8_t *disas_insn(DisasContext *s, uint8_t *pc_start) |
2815 | 2818 | mod = (modrm >> 6) & 3; |
2816 | 2819 | rm = modrm & 7; |
2817 | 2820 | op = ((b & 7) << 3) | ((modrm >> 3) & 7); |
2818 | - | |
2819 | 2821 | if (mod != 3) { |
2820 | 2822 | /* memory op */ |
2821 | 2823 | gen_lea_modrm(s, modrm, ®_addr, &offset_addr); |
... | ... | @@ -4479,7 +4481,7 @@ static inline int gen_intermediate_code_internal(CPUState *env, |
4479 | 4481 | pc_start = (uint8_t *)tb->pc; |
4480 | 4482 | cs_base = (uint8_t *)tb->cs_base; |
4481 | 4483 | flags = tb->flags; |
4482 | - | |
4484 | + | |
4483 | 4485 | dc->pe = (flags >> HF_PE_SHIFT) & 1; |
4484 | 4486 | dc->code32 = (flags >> HF_CS32_SHIFT) & 1; |
4485 | 4487 | dc->ss32 = (flags >> HF_SS32_SHIFT) & 1; | ... | ... |