From: Tom Tromey Date: Mon, 14 May 2018 15:34:00 +0000 (-0600) Subject: Clear rust_unions in rust_union_quirks X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2d79090eabe8aa972b07cb71a3dd73ef9498acfa;p=binutils-gdb.git Clear rust_unions in rust_union_quirks 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 * dwarf2read.c (rust_union_quirks): Clear rust_unions. --- diff --git a/gdb/ChangeLog b/gdb/ChangeLog index 67610d7144b..d795b4a6529 100644 --- a/gdb/ChangeLog +++ b/gdb/ChangeLog @@ -1,3 +1,7 @@ +2018-05-14 Tom Tromey + + * dwarf2read.c (rust_union_quirks): Clear rust_unions. + 2018-05-11 Andrew Burgess * i387-tdep.c (i387_collect_xsave): Use FXSAVE_MXCSR_ADDR not diff --git a/gdb/dwarf2read.c b/gdb/dwarf2read.c index 26ec5efc286..575d316cdde 100644 --- a/gdb/dwarf2read.c +++ b/gdb/dwarf2read.c @@ -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