summaryrefslogtreecommitdiffstats
path: root/gdb/valarith.c
diff options
context:
space:
mode:
authorJan Kratochvil <jan.kratochvil@redhat.com>2010-03-16 20:51:23 +0000
committerJan Kratochvil <jan.kratochvil@redhat.com>2010-03-16 20:51:23 +0000
commitbbb0eef6998678547990f792068fc5a8d3286fa9 (patch)
treed4ed4fd45c42d9ef1da99ed610577785fe22e167 /gdb/valarith.c
parentb8d088acc8f9fe81d5ecbcbbecc694ac0091cb5e (diff)
downloadppe42-binutils-bbb0eef6998678547990f792068fc5a8d3286fa9.tar.gz
ppe42-binutils-bbb0eef6998678547990f792068fc5a8d3286fa9.zip
gdb/
* dwarf2read.c (read_subrange_type): Set TYPE_HIGH_BOUND_UNDEFINED. * valarith.c (value_subscripted_rvalue): Suppress error if TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED.
Diffstat (limited to 'gdb/valarith.c')
-rw-r--r--gdb/valarith.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/valarith.c b/gdb/valarith.c
index 9f91f4e0f0..60f09a610e 100644
--- a/gdb/valarith.c
+++ b/gdb/valarith.c
@@ -198,7 +198,8 @@ value_subscripted_rvalue (struct value *array, LONGEST index, int lowerbound)
unsigned int elt_offs = elt_size * longest_to_int (index - lowerbound);
struct value *v;
- if (index < lowerbound || elt_offs >= TYPE_LENGTH (array_type))
+ if (index < lowerbound || (!TYPE_ARRAY_UPPER_BOUND_IS_UNDEFINED (array_type)
+ && elt_offs >= TYPE_LENGTH (array_type)))
error (_("no such vector element"));
v = allocate_value (elt_type);
OpenPOWER on IntegriCloud