]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
gdb: clear internalvar on destruction
authorSimon Marchi <simon.marchi@efficios.com>
Mon, 10 Mar 2025 15:10:47 +0000 (11:10 -0400)
committerSimon Marchi <simon.marchi@polymtl.ca>
Wed, 19 Mar 2025 19:15:28 +0000 (15:15 -0400)
commitbab86877e484f978ebbd1bfd5cdf15773b36ceee
tree3f992bff4025a5441102a5c9786bc51150c19e79
parenta7f139db2216d73fb40ab6ac43377e716589f6be
gdb: clear internalvar on destruction

The data associated to an internalvar is destroyed when changing the
kind of the internalvar, but not when it is destroyed.  Fix that by
calling clear_internalvar in ~internalvar.

A move constructor becomes needed to avoid freeing things multiple times
when internalvars are moved (and if we forget it, clang helpfully gives
us a -Wdeprecated-copy-with-user-provided-dtor warning).

Change-Id: I427718569208fd955ea25e94d341dde356725033
Reviewed-By: Guinevere Larsen <guinevere@redhat.com>
gdb/value.c