summaryrefslogtreecommitdiff
path: root/target-i386
diff options
context:
space:
mode:
authorPaolo Bonzini <pbonzini@redhat.com>2010-06-04 16:27:33 +0200
committerBlue Swirl <blauwirbel@gmail.com>2010-06-04 19:48:53 +0000
commit8c0e6340fb53cb3f94c0f43abb19eb485f30840e (patch)
tree8eec228c9a8ba5d1e14a8dfcdea1929fae05f27f /target-i386
parent358c360feb346dff8f911e2d1dbcdd6319393f1d (diff)
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 <pbonzini@redhat.com> Acked-by: Richard Henderson <rth@twiddle.net> Signed-off-by: Blue Swirl <blauwirbel@gmail.com>
Diffstat (limited to 'target-i386')
-rw-r--r--target-i386/translate.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/target-i386/translate.c b/target-i386/translate.c
index 38c601657..708b0a11e 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;
}