diff options
author | Tom Tromey <tom@tromey.com> | 2023-03-13 12:53:48 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2023-03-18 11:12:38 -0600 |
commit | e727c536c6e7334484b8dcbf369fe425bd5b892a (patch) | |
tree | e3a36d9571d8b5f0173d0c5c02c3712371ae00e0 /gdb/valops.c | |
parent | 9c794d2d46f0605ee033107418aac2ca20f659f8 (diff) | |
download | binutils-e727c536c6e7334484b8dcbf369fe425bd5b892a.zip binutils-e727c536c6e7334484b8dcbf369fe425bd5b892a.tar.gz binutils-e727c536c6e7334484b8dcbf369fe425bd5b892a.tar.bz2 |
Use type allocator for range types
This changes the range 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
underlying type of the range, 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 | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/gdb/valops.c b/gdb/valops.c index 2cef24f..f655427 100644 --- a/gdb/valops.c +++ b/gdb/valops.c @@ -485,7 +485,8 @@ value_cast (struct type *type, struct value *arg2) "divide object size in cast")); /* FIXME-type-allocation: need a way to free this type when we are done with it. */ - range_type = create_static_range_type (NULL, + type_allocator alloc (range_type->target_type ()); + range_type = create_static_range_type (alloc, range_type->target_type (), low_bound, new_length + low_bound - 1); @@ -4057,7 +4058,8 @@ value_slice (struct value *array, int lowbound, int length) /* FIXME-type-allocation: need a way to free this type when we are done with it. */ - slice_range_type = create_static_range_type (NULL, + type_allocator alloc (range_type->target_type ()); + slice_range_type = create_static_range_type (alloc, range_type->target_type (), lowbound, lowbound + length - 1); |