compile: fix namespace leak related to submodules and compilation

A reference intended to be temporary from a submodule to its enclosing
module wasn't NULLed out.
This commit is contained in:
Matthew Flatt 2014-04-10 10:09:55 -06:00
parent 9ec766fbd4
commit 9c74269877
2 changed files with 3 additions and 1 deletions

View File

@ -7599,6 +7599,8 @@ static Scheme_Object *do_module(Scheme_Object *form, Scheme_Comp_Env *env,
menv->post_ex_rename_set = NULL; menv->post_ex_rename_set = NULL;
} }
m->submodule_ancestry = NULL; /* ancestry no longer needed; NULL to avoid leak */
LOG_END_EXPAND(m); LOG_END_EXPAND(m);
SCHEME_EXPAND_OBSERVE_RENAME_ONE(rec[drec].observer, fm); SCHEME_EXPAND_OBSERVE_RENAME_ONE(rec[drec].observer, fm);

View File

@ -3367,7 +3367,7 @@ typedef struct Scheme_Module
Scheme_Object *pre_submodules, *post_submodules; /* list of modules (when compiled or loaded as a group) */ Scheme_Object *pre_submodules, *post_submodules; /* list of modules (when compiled or loaded as a group) */
Scheme_Object *pre_submodule_names; /* list of symbols (in expand mode) */ Scheme_Object *pre_submodule_names; /* list of symbols (in expand mode) */
Scheme_Object *supermodule; /* supermodule for which this is in {pre,post}_submodules */ Scheme_Object *supermodule; /* supermodule for which this is in {pre,post}_submodules */
Scheme_Object *submodule_ancestry; /* se by compile/expand, temporary */ Scheme_Object *submodule_ancestry; /* set by compile/expand, temporary */
} Scheme_Module; } Scheme_Module;
typedef struct Scheme_Module_Phase_Exports typedef struct Scheme_Module_Phase_Exports