diff options
author | Tom Tromey <tom@tromey.com> | 2023-03-13 13:20:22 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-03-18 11:12:38 -0600 |
commit | 9e76b17aa5a62d866d9446bcc397e35748596193 (patch) | |
tree | 297925e36b11f64e126906d08e528e643544ea33 /gdb/valops.c | |
parent | e727c536c6e7334484b8dcbf369fe425bd5b892a (diff) | |
download | gdb-9e76b17aa5a62d866d9446bcc397e35748596193.zip gdb-9e76b17aa5a62d866d9446bcc397e35748596193.tar.gz gdb-9e76b17aa5a62d866d9446bcc397e35748596193.tar.bz2 |
Use type allocator for array types
This changes the array type creation functions to accept a type
allocator, and updates all the callers. Note that symbol readers
should generally allocate on the relevant objfile, regardless of the
placement of the index type of the array, which is what this patch
implements.
Reviewed-By: Simon Marchi <simon.marchi@efficios.com>
Diffstat (limited to 'gdb/valops.c')
-rw-r--r-- | gdb/valops.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index f655427..bf9d6a7 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -490,7 +490,7 @@ value_cast (struct type *type, struct value *arg2) range_type->target_type (), low_bound, new_length + low_bound - 1); - arg2->deprecated_set_type (create_array_type (NULL, + arg2->deprecated_set_type (create_array_type (alloc, element_type, range_type)); return arg2; @@ -4069,7 +4069,7 @@ value_slice (struct value *array, int lowbound, int length) LONGEST offset = (lowbound - lowerbound) * check_typedef (element_type)->length (); - slice_type = create_array_type (NULL, + slice_type = create_array_type (alloc, element_type, slice_range_type); slice_type->set_code (array_type->code ()); |