]> git.ipfire.org Git - thirdparty/binutils-gdb.git/commit
[gdb] Don't create registry keys in destructor
authorTom de Vries <tdevries@suse.de>
Sat, 26 Oct 2024 06:40:07 +0000 (08:40 +0200)
committerTom de Vries <tdevries@suse.de>
Sat, 26 Oct 2024 06:40:07 +0000 (08:40 +0200)
commit5a43f7f040d45ca1bc0066019131cf71d7836cb8
tree7472785973203b3aba4bf19690e107fd0adc6a30
parentb3ee98cda498bb256411c5bc23cf7fb9b17f10db
[gdb] Don't create registry keys in destructor

Creating a registry key using emplace calls new:
...
      DATA *result = new DATA (std::forward<Args> (args)...);
...
which can throw a bad alloc, which will terminate gdb if called from a
destructor.

Fix this in a few places.

Tested on aarch64-linux.

Approved-By: Tom Tromey <tom@tromey.com>
gdb/ada-tasks.c
gdb/objfiles.c
gdb/solib-svr4.c
gdb/source.c
gdb/source.h
gdb/symtab.c