aboutsummaryrefslogtreecommitdiff
path: root/gdb/compile
diff options
context:
space:
mode:
authorTom Tromey <tom@tromey.com>2020-09-17 11:47:50 -0600
committerTom Tromey <tom@tromey.com>2020-09-17 11:58:56 -0600
commit6108fd1823f9cf036bbbe528ffcdf2fee489b40a (patch)
tree0be755427c836f6981902a0a49b5b84f0f36f4dc /gdb/compile
parentfa9b11648c07ecb02a9c038304d646a5c652a5e7 (diff)
downloadgdb-6108fd1823f9cf036bbbe528ffcdf2fee489b40a.zip
gdb-6108fd1823f9cf036bbbe528ffcdf2fee489b40a.tar.gz
gdb-6108fd1823f9cf036bbbe528ffcdf2fee489b40a.tar.bz2
Use htab_up in type copying
This changes create_copied_types_hash to return an htab_up, then modifies the callers to avoid explicit use of htab_delete. gdb/ChangeLog 2020-09-17 Tom Tromey <tom@tromey.com> * value.c (preserve_values): Update. * python/py-type.c (save_objfile_types): Update. * guile/scm-type.c (save_objfile_types): Update. * gdbtypes.h (create_copied_types_hash): Return htab_up. * gdbtypes.c (create_copied_types_hash): Return htab_up. * compile/compile-object-run.c (compile_object_run): Update.
Diffstat (limited to 'gdb/compile')
-rw-r--r--gdb/compile/compile-object-run.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/gdb/compile/compile-object-run.c b/gdb/compile/compile-object-run.c
index a2f3990..533478a 100644
--- a/gdb/compile/compile-object-run.c
+++ b/gdb/compile/compile-object-run.c
@@ -140,14 +140,12 @@ compile_object_run (struct compile_module *module)
try
{
struct type *func_type = SYMBOL_TYPE (func_sym);
- htab_t copied_types;
int current_arg = 0;
struct value **vargs;
/* OBJFILE may disappear while FUNC_TYPE still will be in use. */
- copied_types = create_copied_types_hash (objfile);
- func_type = copy_type_recursive (objfile, func_type, copied_types);
- htab_delete (copied_types);
+ htab_up copied_types = create_copied_types_hash (objfile);
+ func_type = copy_type_recursive (objfile, func_type, copied_types.get ());
gdb_assert (func_type->code () == TYPE_CODE_FUNC);
func_val = value_from_pointer (lookup_pointer_type (func_type),