From 0b5d8877912034b2af0c548afbb794e4dcd07fbd Mon Sep 17 00:00:00 2001 From: "Paul N. Hilfinger" Date: Thu, 1 Jul 2004 10:30:57 +0000 Subject: * ada-lang.c (decode_packed_array): Minor change to comment. (ada_value_slice_ptr): New function. (ada_value_slice): New function. (ada_evaluate_subexp): Remove XVS-suffix code from subscripting test. Don't know why it is there. Change slice code to use ada_value_slice_ptr and ada_value_slice, and to avoid dereferencing huge arrays from which one is slicing. (empty_array): Correct to return an array rather than a subrange value. * ada-valprint.c (print_optional_low_bound): Don't print lower bound on empty arrays (let'em use 'FIRST instead). --- gdb/ada-valprint.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'gdb/ada-valprint.c') diff --git a/gdb/ada-valprint.c b/gdb/ada-valprint.c index c7440e6..55baf10 100644 --- a/gdb/ada-valprint.c +++ b/gdb/ada-valprint.c @@ -86,10 +86,10 @@ adjust_type_signedness (struct type *type) TYPE_FLAGS (type) |= TYPE_FLAG_UNSIGNED; } -/* Assuming TYPE is a simple array type, prints its lower bound on STREAM, - if non-standard (i.e., other than 1 for numbers, other than lower bound - of index type for enumerated type). Returns 1 if something printed, - otherwise 0. */ +/* Assuming TYPE is a simple, non-empty array type, prints its lower bound + on STREAM, if non-standard (i.e., other than 1 for numbers, other + than lower bound of index type for enumerated type). Returns 1 + if something printed, otherwise 0. */ static int print_optional_low_bound (struct ui_file *stream, struct type *type) @@ -105,6 +105,8 @@ print_optional_low_bound (struct ui_file *stream, struct type *type) if (TYPE_CODE (index_type) == TYPE_CODE_RANGE) { low_bound = TYPE_LOW_BOUND (index_type); + if (low_bound > TYPE_HIGH_BOUND (index_type)) + return 0; index_type = TYPE_TARGET_TYPE (index_type); } else -- cgit v1.1