diff options
author | Tom Tromey <tom@tromey.com> | 2022-08-02 11:57:20 -0600 |
---|---|---|
committer | Tom Tromey <tom@tromey.com> | 2022-08-03 13:26:58 -0600 |
commit | 075e4d6d95681bfbf53e849c2802a75d1d4cbdca (patch) | |
tree | 603d88f26edb4f995a0f4820b0cd7c8bc46c76e3 /gdb/objfiles.h | |
parent | 98badbfdc222d1d7f346046f23a64522b88d22a0 (diff) | |
download | fsf-binutils-gdb-075e4d6d95681bfbf53e849c2802a75d1d4cbdca.zip fsf-binutils-gdb-075e4d6d95681bfbf53e849c2802a75d1d4cbdca.tar.gz fsf-binutils-gdb-075e4d6d95681bfbf53e849c2802a75d1d4cbdca.tar.bz2 |
Use auto_obstack in objfile
This changes objfile to use an auto_obstack. This helps prevent
use-after-free bugs, because it ensures that anything allocated on the
objfile obstack will live past the point at which the registry object
is destroyed.
Diffstat (limited to 'gdb/objfiles.h')
-rw-r--r-- | gdb/objfiles.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/objfiles.h b/gdb/objfiles.h index eb85ed4..ac45fa3 100644 --- a/gdb/objfiles.h +++ b/gdb/objfiles.h @@ -666,7 +666,7 @@ public: /* Obstack to hold objects that should be freed when we load a new symbol table from this object file. */ - struct obstack objfile_obstack {}; + auto_obstack objfile_obstack; /* Structure which keeps track of functions that manipulate objfile's of the same type as this objfile. I.e. the function to read partial |