From nobody Sun Apr 28 20:09:18 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) client-ip=208.118.235.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Authentication-Results: mx.zoho.com; spf=pass (zoho.com: domain of gnu.org designates 208.118.235.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; Return-Path: Received: from lists.gnu.org (lists.gnu.org [208.118.235.17]) by mx.zohomail.com with SMTPS id 1490970749595114.53521628841133; Fri, 31 Mar 2017 07:32:29 -0700 (PDT) Received: from localhost ([::1]:41357 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctxbH-0004Eb-Te for importer@patchew.org; Fri, 31 Mar 2017 10:32:27 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34336) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ctxa8-0003ZX-TF for qemu-devel@nongnu.org; Fri, 31 Mar 2017 10:31:17 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ctxa8-0001oI-51 for qemu-devel@nongnu.org; Fri, 31 Mar 2017 10:31:16 -0400 Received: from orth.archaic.org.uk ([2001:8b0:1d0::2]:49019) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1ctxa7-0001nJ-Tt for qemu-devel@nongnu.org; Fri, 31 Mar 2017 10:31:16 -0400 Received: from pm215 by orth.archaic.org.uk with local (Exim 4.84_2) (envelope-from ) id 1ctxa4-0004CK-7C; Fri, 31 Mar 2017 15:31:12 +0100 From: Peter Maydell To: qemu-devel@nongnu.org Date: Fri, 31 Mar 2017 15:31:11 +0100 Message-Id: <1490970671-20560-1-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 2.7.4 X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2001:8b0:1d0::2 Subject: [Qemu-devel] [PATCH] disas/cris.c: Avoid unintentional sign extension X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Edgar E. Iglesias" , patches@linaro.org Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: "Qemu-devel" X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Commit 001ebaca7b11 fixed some unintended sign extension issues spotted by Coverity (CID 1005402, 1005403), but didn't catch all of them. Fix the rest, so we behave consistently whether 'long' is 32 bit or 64 bit. Signed-off-by: Peter Maydell Reviewed-by: Edgar E. Iglesias --- disas/cris.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/disas/cris.c b/disas/cris.c index 30217f1..2dd56de 100644 --- a/disas/cris.c +++ b/disas/cris.c @@ -2048,7 +2048,7 @@ print_with_operands (const struct cris_opcode *opcode= p, { /* We're looking at [pc+], i.e. we need to output an immediate number, where the size can depend on different things. */ - long number; + int32_t number; int signedp =3D ((*cs =3D=3D 'z' && (insn & 0x20)) || opcodep->match =3D=3D BDAP_QUICK_OPCODE); @@ -2290,7 +2290,7 @@ print_with_operands (const struct cris_opcode *opcode= p, =20 if ((prefix_insn & 0x400) && (prefix_insn & 15) =3D=3D 15) { - long number; + int32_t number; unsigned int nbytes; =20 /* It's a value. Get its size. */ --=20 2.7.4