aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-16 22:10:33 +0000
committerbellard <bellard@c046a42c-6fe2-441c-8c8c-71466251a162>2004-02-16 22:10:33 +0000
commit3a1d9b8bbb693d18a346552a5e98c96ad5006ff9 (patch)
tree9c75397e39148a555c6e07dbd8facabc14fbeff3
parent0e4b179d3308382e9da91a3b8f443d0b72eb0db4 (diff)
fixed lea exception
git-svn-id: svn://svn.savannah.nongnu.org/qemu/trunk@622 c046a42c-6fe2-441c-8c8c-71466251a162
-rw-r--r--target-i386/translate.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 0bbd160b42..6e8d8116c7 100644
--- a/target-i386/translate.c
+++ b/target-i386/translate.c
@@ -2554,6 +2554,9 @@ static uint8_t *disas_insn(DisasContext *s, uint8_t *pc_start)
case 0x8d: /* lea */
ot = dflag ? OT_LONG : OT_WORD;
modrm = ldub_code(s->pc++);
+ mod = (modrm >> 6) & 3;
+ if (mod == 3)
+ goto illegal_op;
reg = (modrm >> 3) & 7;
/* we must ensure that no segment is added */
s->override = -1;
@@ -2815,7 +2818,6 @@ static uint8_t *disas_insn(DisasContext *s, uint8_t *pc_start)
mod = (modrm >> 6) & 3;
rm = modrm & 7;
op = ((b & 7) << 3) | ((modrm >> 3) & 7);
-
if (mod != 3) {
/* memory op */
gen_lea_modrm(s, modrm, &reg_addr, &offset_addr);
@@ -4479,7 +4481,7 @@ static inline int gen_intermediate_code_internal(CPUState *env,
pc_start = (uint8_t *)tb->pc;
cs_base = (uint8_t *)tb->cs_base;
flags = tb->flags;
-
+
dc->pe = (flags >> HF_PE_SHIFT) & 1;
dc->code32 = (flags >> HF_CS32_SHIFT) & 1;
dc->ss32 = (flags >> HF_SS32_SHIFT) & 1;