From patchwork Fri Feb 6 14:34:10 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Peter Maydell X-Patchwork-Id: 44486 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-wi0-f200.google.com (mail-wi0-f200.google.com [209.85.212.200]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id E56B421521 for ; Fri, 6 Feb 2015 14:34:17 +0000 (UTC) Received: by mail-wi0-f200.google.com with SMTP id fb4sf2060913wid.3 for ; Fri, 06 Feb 2015 06:34:17 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:mime-version:delivered-to:from:to:cc:subject :date:message-id:in-reply-to:references:x-original-sender :x-original-authentication-results:precedence:mailing-list:list-id :list-post:list-help:list-archive:list-unsubscribe; bh=eM9Xvg2WT15pXta+e72P3HmUUMlq2Rrnn6mPkpmJ8i4=; b=BCNqPyGkNXyeVuKoyeqe6vq35ipeCcJtMbo5Phlhr6NmEiaPBEkE8r+eXpPAyqddU1 CGOX/iQezgC6DxqawBQnAApv2NGAFx4WpHjoB1+ZY4klbpN/S0O+tk3bYLwouFJ/rhJC a8rkOaB8plEVvyYOngrTbAkXRRrwGsjm9JoKZxExGXA2iL8IOKpV63zINZO1ULqerQmF e1yf+JHvMR2DpZqJlfyDi6J7onQdsdSUagX0y02wwi2Q2NbEbaTDautaDO444Ckf9iNZ A3CrgK9YR4oBkM38R2xqQSCiVAdOovWpP6K3w7VEUOUaYSAsXqos2P8d481ZG6xbGYch EP3Q== X-Gm-Message-State: ALoCoQlVocdHhgqMKnP5e2BxrWsDjWATVd1EM+CS63TRJGgV+vxlyTNLd6ZpKqfQG8yrqTeOye3/ X-Received: by 10.112.180.167 with SMTP id dp7mr496819lbc.14.1423233257195; Fri, 06 Feb 2015 06:34:17 -0800 (PST) MIME-Version: 1.0 X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.3.4 with SMTP id 4ls268202lay.65.gmail; Fri, 06 Feb 2015 06:34:16 -0800 (PST) X-Received: by 10.112.166.73 with SMTP id ze9mr3056777lbb.38.1423233256893; Fri, 06 Feb 2015 06:34:16 -0800 (PST) Received: from mail-lb0-f181.google.com (mail-lb0-f181.google.com. [209.85.217.181]) by mx.google.com with ESMTPS id la5si1462552lac.113.2015.02.06.06.34.16 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 06 Feb 2015 06:34:16 -0800 (PST) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) client-ip=209.85.217.181; Received: by mail-lb0-f181.google.com with SMTP id u14so11840724lbd.12 for ; Fri, 06 Feb 2015 06:34:16 -0800 (PST) X-Received: by 10.112.114.230 with SMTP id jj6mr2978352lbb.112.1423233256586; Fri, 06 Feb 2015 06:34:16 -0800 (PST) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patches@linaro.org Received: by 10.112.35.133 with SMTP id h5csp1840097lbj; Fri, 6 Feb 2015 06:34:15 -0800 (PST) X-Received: by 10.68.78.4 with SMTP id x4mr6361528pbw.74.1423233254899; Fri, 06 Feb 2015 06:34:14 -0800 (PST) Received: from mnementh.archaic.org.uk (mnementh.archaic.org.uk. [2001:8b0:1d0::1]) by mx.google.com with ESMTPS id jd2si10529965pbd.105.2015.02.06.06.34.13 for (version=TLSv1.2 cipher=RC4-SHA bits=128/128); Fri, 06 Feb 2015 06:34:14 -0800 (PST) Received-SPF: none (google.com: pm215@archaic.org.uk does not designate permitted sender hosts) client-ip=2001:8b0:1d0::1; Received: from pm215 by mnementh.archaic.org.uk with local (Exim 4.80) (envelope-from ) id 1YJjz1-00048P-4q; Fri, 06 Feb 2015 14:34:11 +0000 From: Peter Maydell To: qemu-devel@nongnu.org Cc: patches@linaro.org, Richard Henderson Subject: [PATCH 4/4] target-arm: A64: Avoid signed shifts in disas_ldst_pair() Date: Fri, 6 Feb 2015 14:34:10 +0000 Message-Id: <1423233250-15853-5-git-send-email-peter.maydell@linaro.org> X-Mailer: git-send-email 1.7.10.4 In-Reply-To: <1423233250-15853-1-git-send-email-peter.maydell@linaro.org> References: <1423233250-15853-1-git-send-email-peter.maydell@linaro.org> X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: peter.maydell@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.217.181 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Precedence: list Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org List-ID: X-Google-Group-Id: 836684582541 List-Post: , List-Help: , List-Archive: List-Unsubscribe: , Avoid shifting potentially negative signed offset values in disas_ldst_pair() by keeping the offset in a uint64_t rather than an int64_t. Signed-off-by: Peter Maydell --- target-arm/translate-a64.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/target-arm/translate-a64.c b/target-arm/translate-a64.c index 68c5b23..9f54501 100644 --- a/target-arm/translate-a64.c +++ b/target-arm/translate-a64.c @@ -1917,7 +1917,7 @@ static void disas_ldst_pair(DisasContext *s, uint32_t insn) int rt = extract32(insn, 0, 5); int rn = extract32(insn, 5, 5); int rt2 = extract32(insn, 10, 5); - int64_t offset = sextract32(insn, 15, 7); + uint64_t offset = sextract64(insn, 15, 7); int index = extract32(insn, 23, 2); bool is_vector = extract32(insn, 26, 1); bool is_load = extract32(insn, 22, 1);