From 8c0e6340fb53cb3f94c0f43abb19eb485f30840e Mon Sep 17 00:00:00 2001 From: Paolo Bonzini Date: Fri, 4 Jun 2010 16:27:33 +0200 Subject: [PATCH] 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 --- target-i386/translate.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; }