From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from [140.186.70.92] (port=40919 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1OKXzd-0006Lk-Vt for qemu-devel@nongnu.org; Fri, 04 Jun 2010 10:35:35 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.69) (envelope-from ) id 1OKXs7-0005G1-6C for qemu-devel@nongnu.org; Fri, 04 Jun 2010 10:27:47 -0400 Received: from mail-ww0-f45.google.com ([74.125.82.45]:39857) by eggs.gnu.org with esmtp (Exim 4.69) (envelope-from ) id 1OKXs6-0005Fu-Vj for qemu-devel@nongnu.org; Fri, 04 Jun 2010 10:27:43 -0400 Received: by wwb13 with SMTP id 13so981390wwb.4 for ; Fri, 04 Jun 2010 07:27:39 -0700 (PDT) Sender: Paolo Bonzini From: Paolo Bonzini Date: Fri, 4 Jun 2010 16:27:33 +0200 Message-Id: <1275661653-16726-1-git-send-email-pbonzini@redhat.com> In-Reply-To: <4C08D2F3.6060007@redhat.com> References: <4C08D2F3.6060007@redhat.com> Subject: [Qemu-devel] [PATCH] target-i386: fix decoding of negative 4-byte displacements List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: Blue Swirl , Igor Kovalenko Negative four byte displacements need to be sign-extended after c086b783eb7a578993d6d2ab62c4c2666800b63d. Do so. Signed-off-by: Paolo Bonzini --- There are quite a few other ldl's to audit after the patch (about 70 in target-*). Any volunteers? :-) target-i386/translate.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/target-i386/translate.c b/target-i386/translate.c index 38c6016..708b0a1 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; } -- 1.7.0.1