aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Baldwin <jhb@FreeBSD.org>2016-06-11 07:38:42 -0700
committerJohn Baldwin <jhb@FreeBSD.org>2016-07-06 06:08:04 -0700
commitd66ff635bec25bf940cc6d173a92f7796f18b310 (patch)
tree78d246203d687c6f2bffae48d3302485747e6272
parentee950322ca2c77494b1742f304632f667ed6ce79 (diff)
downloadgdb-d66ff635bec25bf940cc6d173a92f7796f18b310.zip
gdb-d66ff635bec25bf940cc6d173a92f7796f18b310.tar.gz
gdb-d66ff635bec25bf940cc6d173a92f7796f18b310.tar.bz2
Remove check for negative size.
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.
-rw-r--r--gdb/ChangeLog5
-rw-r--r--gdb/score-tdep.c8
2 files changed, 6 insertions, 7 deletions
diff --git a/gdb/ChangeLog b/gdb/ChangeLog
index bf164bc..9957227 100644
--- a/gdb/ChangeLog
+++ b/gdb/ChangeLog
@@ -1,5 +1,10 @@
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.
2016-07-06 Yao Qi <yao.qi@linaro.org>
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);