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.
This commit is contained in:
parent
98badbfdc2
commit
075e4d6d95
2 changed files with 1 additions and 8 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue