aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--gdb/ppc-sysv-tdep.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gdb/ppc-sysv-tdep.c b/gdb/ppc-sysv-tdep.c
index 20e732f..dd6f44c 100644
--- a/gdb/ppc-sysv-tdep.c
+++ b/gdb/ppc-sysv-tdep.c
@@ -1127,7 +1127,11 @@ ppc64_aggregate_candidate (struct type *type,
if (!get_array_bounds (type, &low_bound, &high_bound))
return -1;
- count *= high_bound - low_bound;
+
+ LONGEST nr_array_elements = (low_bound > high_bound
+ ? 0
+ : (high_bound - low_bound + 1));
+ count *= nr_array_elements;
/* There must be no padding. */
if (count == 0)