From: Paolo Bonzini Date: Fri, 4 Jun 2010 14:27:33 +0000 (+0200) Subject: target-i386: fix decoding of negative 4-byte displacements X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=8c0e6340fb53cb3f94c0f43abb19eb485f30840e;p=qemu.git target-i386: fix decoding of negative 4-byte displacements Negative four byte displacements need to be sign-extended after c086b783eb7a578993d6d2ab62c4c2666800b63d. Do so. Signed-off-by: Paolo Bonzini Acked-by: Richard Henderson Signed-off-by: Blue Swirl --- diff --git a/target-i386/translate.c b/target-i386/translate.c index 38c6016574..708b0a11e9 100644 --- a/target-i386/translate.c +++ b/target-i386/translate.c @@ -2016,7 +2016,7 @@ static void gen_lea_modrm(DisasContext *s, int modrm, int *reg_ptr, int *offset_ break; default: case 2: - disp = ldl_code(s->pc); + disp = (int32_t)ldl_code(s->pc); s->pc += 4; break; }