From patchwork Sat Jun 11 20:48:31 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: John Baldwin X-Patchwork-Id: 12993 Received: (qmail 4920 invoked by alias); 11 Jun 2016 20:56:31 -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 4823 invoked by uid 89); 11 Jun 2016 20:56:30 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=1.1 required=5.0 tests=AWL, BAYES_50, SPF_HELO_PASS, SPF_SOFTFAIL autolearn=no version=3.3.2 spammy=2.7.0, baldwin, Baldwin, U*jhb X-Spam-User: qpsmtpd, 2 recipients X-HELO: bigwig.baldwin.cx Received: from bigwig.baldwin.cx (HELO bigwig.baldwin.cx) (96.47.65.170) by sourceware.org (qpsmtpd/0.93/v0.84-503-g423c35a) with (CAMELLIA256-SHA encrypted) ESMTPS; Sat, 11 Jun 2016 20:56:19 +0000 Received: from ralph.baldwin.cx.net (c-73-231-226-104.hsd1.ca.comcast.net [73.231.226.104]) by bigwig.baldwin.cx (Postfix) with ESMTPSA id 47116B9BB; Sat, 11 Jun 2016 16:49:26 -0400 (EDT) From: John Baldwin To: gdb-patches@sourceware.org, binutils@sourceware.org Subject: [PATCH 4/8] Remove check for negative size. Date: Sat, 11 Jun 2016 13:48:31 -0700 Message-Id: <1465678115-58170-5-git-send-email-jhb@FreeBSD.org> In-Reply-To: <1465678115-58170-1-git-send-email-jhb@FreeBSD.org> References: <1465678115-58170-1-git-send-email-jhb@FreeBSD.org> X-IsSubscribed: yes Since CORE_ADDR is unsigned, this value can never be negative. gdb/ChangeLog: * score-tdep.c (score7_malloc_and_get_memblock): Remove check for negative size. --- gdb/ChangeLog | 5 +++++ gdb/score-tdep.c | 8 +------- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 38fcb30..73f42e2 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,5 +1,10 @@ 2016-06-11 John Baldwin + * score-tdep.c (score7_malloc_and_get_memblock): Remove check for + negative size. + +2016-06-11 John Baldwin + * rs6000-tdep.c (ppc_process_record_op31): Initialize ra. 2016-06-10 Tom Tromey diff --git a/gdb/score-tdep.c b/gdb/score-tdep.c index 0d817f8..8e08d05 100644 --- a/gdb/score-tdep.c +++ b/gdb/score-tdep.c @@ -813,13 +813,7 @@ score7_malloc_and_get_memblock (CORE_ADDR addr, CORE_ADDR size) int ret; gdb_byte *memblock = NULL; - if (size < 0) - { - error (_("Error: malloc size < 0 in file:%s, line:%d!"), - __FILE__, __LINE__); - return NULL; - } - else if (size == 0) + if (size == 0) return NULL; memblock = (gdb_byte *) xmalloc (size);