diff mbox

[4/8] Remove check for negative size.

Message ID 1465678115-58170-5-git-send-email-jhb@FreeBSD.org
State New
Headers show

Commit Message

John Baldwin June 11, 2016, 8:48 p.m. UTC
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 mbox

Patch

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  <jhb@FreeBSD.org>
 
+	* score-tdep.c (score7_malloc_and_get_memblock): Remove check for
+	negative size.
+
+2016-06-11  John Baldwin  <jhb@FreeBSD.org>
+
 	* rs6000-tdep.c (ppc_process_record_op31): Initialize ra.
 
 2016-06-10  Tom Tromey  <tom@tromey.com>
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);