mirror of
https://github.com/espressif/binutils-gdb.git
synced 2025-08-06 06:45:56 +08:00
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>
This commit is contained in:
@ -831,7 +831,8 @@ read_array_type (struct ctf_context *ccp, ctf_id_t tid)
|
||||
if (idx_type == nullptr)
|
||||
idx_type = objfile_type (objfile)->builtin_int;
|
||||
|
||||
range_type = create_static_range_type (NULL, idx_type, 0, ar.ctr_nelems - 1);
|
||||
type_allocator alloc (objfile);
|
||||
range_type = create_static_range_type (alloc, idx_type, 0, ar.ctr_nelems - 1);
|
||||
type = create_array_type (NULL, element_type, range_type);
|
||||
if (ar.ctr_nelems <= 1) /* Check if undefined upper bound. */
|
||||
{
|
||||
|
Reference in New Issue
Block a user