summaryrefslogtreecommitdiff
path: root/gdb/coffread.c
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2023-03-13 12:53:48 -0600
committerTom Tromey <tom@tromey.com>2023-03-18 11:12:38 -0600
commite727c536c6e7334484b8dcbf369fe425bd5b892a (patch)
treee3a36d9571d8b5f0173d0c5c02c3712371ae00e0 /gdb/coffread.c
parent9c794d2d46f0605ee033107418aac2ca20f659f8 (diff)
downloadbinutils-gdb-e727c536c6e7334484b8dcbf369fe425bd5b892a.tar.gz
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/coffread.c')
-rw-r--r--gdb/coffread.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/gdb/coffread.c b/gdb/coffread.c
index 1b0442a2ad4..ef92ffdc571 100644
--- a/gdb/coffread.c
+++ b/gdb/coffread.c
@@ -1780,8 +1780,9 @@ decode_type (struct coff_symbol *cs, unsigned int c_type,
base_type = decode_type (cs, new_c_type, aux, objfile);
index_type = objfile_type (objfile)->builtin_int;
+ type_allocator alloc (objfile);
range_type
- = create_static_range_type (NULL, index_type, 0, n - 1);
+ = create_static_range_type (alloc, index_type, 0, n - 1);
type =
create_array_type (NULL, base_type, range_type);
}