From patchwork Fri Apr 24 14:30:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nick Clifton X-Patchwork-Id: 6426 Received: (qmail 109094 invoked by alias); 24 Apr 2015 14:30:43 -0000 Mailing-List: contact gdb-patches-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: gdb-patches-owner@sourceware.org Delivered-To: mailing list gdb-patches@sourceware.org Received: (qmail 109082 invoked by uid 89); 24 Apr 2015 14:30:42 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-3.6 required=5.0 tests=AWL, BAYES_00, SPF_HELO_PASS, SPF_PASS, T_RP_MATCHES_RCVD autolearn=ham version=3.3.2 X-HELO: mx1.redhat.com Received: from mx1.redhat.com (HELO mx1.redhat.com) (209.132.183.28) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (AES256-GCM-SHA384 encrypted) ESMTPS; Fri, 24 Apr 2015 14:30:42 +0000 Received: from int-mx09.intmail.prod.int.phx2.redhat.com (int-mx09.intmail.prod.int.phx2.redhat.com [10.5.11.22]) by mx1.redhat.com (8.14.4/8.14.4) with ESMTP id t3OEUfmi006995 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL) for ; Fri, 24 Apr 2015 10:30:41 -0400 Received: from littlehelper.redhat.com (vpn1-7-214.ams2.redhat.com [10.36.7.214]) by int-mx09.intmail.prod.int.phx2.redhat.com (8.14.4/8.14.4) with ESMTP id t3OEUd0b019145 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Fri, 24 Apr 2015 10:30:40 -0400 From: Nick Clifton To: dj@redhat.com Cc: gdb-patches@sourceware.org Subject: Commit: RX SIM: Obvious fix for valid register check Date: Fri, 24 Apr 2015 15:30:38 +0100 Message-ID: <87mw1xegz5.fsf@redhat.com> MIME-Version: 1.0 Hi DJ, I am applying the patch below as an obvious fix for a typo in the valid register check in sim/rx/reg.c:put_reg(). This bug was reported in PR 18273 by running a static analyser over the sim sources. Cheers Nick sim/rx/ChangeLog 2015-04-24 Nick Clifton PR sim/18273 * reg.c (put_reg): Fix check for valid register number. diff --git a/sim/rx/reg.c b/sim/rx/reg.c index 0fbd4c3..6effe4b 100644 --- a/sim/rx/reg.c +++ b/sim/rx/reg.c @@ -253,7 +253,7 @@ put_reg (int id, unsigned int v) } default: - if (id >= 1 || id <= 15) + if (id >= 1 && id <= 15) regs.r[id] = v; else abort ();