Clear rust_unions in rust_union_quirks
authorTom Tromey <tom@tromey.com>
Mon, 14 May 2018 15:34:00 +0000 (09:34 -0600)
committerTom Tromey <tom@tromey.com>
Mon, 14 May 2018 15:36:56 +0000 (09:36 -0600)
It turns out that a dwarf2_cu can remain allocated after psymtab
expansion is done, and so it makes sense to clear rust_unions when
done processing it.

Tested on x86-64 Fedora 27.

2018-05-14  Tom Tromey  <tom@tromey.com>

* dwarf2read.c (rust_union_quirks): Clear rust_unions.

gdb/ChangeLog
gdb/dwarf2read.c

index 67610d7144b71b9207c549bf6918e500e0496aa9..d795b4a65291ef6830f00ede7e6d3cc0495379c1 100644 (file)
@@ -1,3 +1,7 @@
+2018-05-14  Tom Tromey  <tom@tromey.com>
+
+       * dwarf2read.c (rust_union_quirks): Clear rust_unions.
+
 2018-05-11  Andrew Burgess  <andrew.burgess@embecosm.com>
 
        * i387-tdep.c (i387_collect_xsave): Use FXSAVE_MXCSR_ADDR not
index 26ec5efc286609a5275fcec4e959adb170962bf2..575d316cdde2470fa7729b2010360868b79223c4 100644 (file)
@@ -10105,6 +10105,8 @@ rust_union_quirks (struct dwarf2_cu *cu)
   gdb_assert (cu->language == language_rust);
   for (struct type *type : cu->rust_unions)
     quirk_rust_enum (type, cu->per_cu->dwarf2_per_objfile->objfile);
+  /* We don't need this any more.  */
+  cu->rust_unions.clear ();
 }
 
 /* Return the symtab for PER_CU.  This works properly regardless of
This page took 0.03547 seconds and 4 git commands to generate.