fix internal array size on module redeclaration

If a module is redeclared with more phases than before,
expand the `running` array.
This commit is contained in:
Matthew Flatt 2016-02-04 16:07:10 -07:00
parent 7982a59a1d
commit 35acfab903

View File

@ -5433,6 +5433,12 @@ static Scheme_Env *instantiate_module(Scheme_Module *m, Scheme_Env *env, int res
} else {
Scheme_Env *env2;
if (menv->module->num_phases < m->num_phases) {
char *running;
running = (char *)scheme_malloc_atomic(m->num_phases);
menv->running = running;
}
menv->module = m;
memset(menv->running, 0, menv->module->num_phases);
menv->ran = 0;