* ada-lang.c (ada_coerce_to_simple_array_type): Reimplement to

avoid creating a dummy value.
This commit is contained in:
Ulrich Weigand 2009-05-18 13:47:44 +00:00
parent 830bb937a1
commit 17280b9f0a
2 changed files with 12 additions and 7 deletions

View file

@ -1,3 +1,8 @@
2009-05-18 Ulrich Weigand <uweigand@de.ibm.com>
* ada-lang.c (ada_coerce_to_simple_array_type): Reimplement to
avoid creating a dummy value.
2009-05-18 Ulrich Weigand <uweigand@de.ibm.com> 2009-05-18 Ulrich Weigand <uweigand@de.ibm.com>
* p-valprint.c (pascal_val_print): Use extract_typed_address * p-valprint.c (pascal_val_print): Use extract_typed_address

View file

@ -1689,13 +1689,13 @@ ada_coerce_to_simple_array (struct value *arr)
struct type * struct type *
ada_coerce_to_simple_array_type (struct type *type) ada_coerce_to_simple_array_type (struct type *type)
{ {
struct value *mark = value_mark (); if (ada_is_packed_array_type (type))
struct value *dummy = value_from_longest (builtin_type_int32, 0); return decode_packed_array_type (type);
struct type *result;
deprecated_set_value_type (dummy, type); if (ada_is_array_descriptor_type (type))
result = ada_type_of_array (dummy, 0); return ada_check_typedef (TYPE_TARGET_TYPE (desc_data_type (type)));
value_free_to_mark (mark);
return result; return type;
} }
/* Non-zero iff TYPE represents a standard GNAT packed-array type. */ /* Non-zero iff TYPE represents a standard GNAT packed-array type. */