Remove check for negative size.
authorJohn Baldwin <jhb@FreeBSD.org>
Sat, 11 Jun 2016 14:38:42 +0000 (07:38 -0700)
committerJohn Baldwin <jhb@FreeBSD.org>
Wed, 6 Jul 2016 13:08:04 +0000 (06:08 -0700)
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
gdb/score-tdep.c

index bf164bc4ca497a52dc281bcc9ced014acb5e1e15..9957227c8a5b8fc351edaab7e8ff729865eb97c4 100644 (file)
@@ -1,3 +1,8 @@
+2016-07-06  John Baldwin  <jhb@FreeBSD.org>
+
+       * score-tdep.c (score7_malloc_and_get_memblock): Remove check for
+       negative size.
+
 2016-07-06  John Baldwin  <jhb@FreeBSD.org>
 
        * fbsd-nat.c (fbsd_is_vfork_done_pending): Fix return type.
index 0d817f806796df8e66ba105da01223f645799f35..8e08d0553283df3caa0aee8c316eecd6d4bdf732 100644 (file)
@@ -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);