Scope: lookup_ID() and install_ID() return IntrusivePtr<ID>

This fixes several memory leaks and double free bugs.
This commit is contained in:
Max Kellermann 2020-02-26 07:58:06 +01:00
parent cbb6f09726
commit 528cf11a5c
14 changed files with 60 additions and 100 deletions

View file

@ -88,10 +88,10 @@ extern bool in_debug;
// If no_global is true, don't search in the default "global" namespace.
// This passed ownership of a ref'ed ID to the caller.
extern ID* lookup_ID(const char* name, const char* module,
extern IntrusivePtr<ID> lookup_ID(const char* name, const char* module,
bool no_global = false, bool same_module_only = false,
bool check_export = true);
extern ID* install_ID(const char* name, const char* module_name,
extern IntrusivePtr<ID> install_ID(const char* name, const char* module_name,
bool is_global, bool is_export);
extern void push_scope(ID* id, attr_list* attrs);