Need to adjust the stack length of the top-level environment; fix #3819

parent c3710dbb
......@@ -544,6 +544,13 @@ done:
if (args.verbose) {
mrb_codedump_all(mrb, proc);
}
/* adjest stack length of toplevel environment */
if (mrb->c->cibase->env) {
struct REnv *e = mrb->c->cibase->env;
if (MRB_ENV_STACK_LEN(e) < proc->body.irep->nlocals) {
MRB_SET_ENV_STACK_LEN(e, proc->body.irep->nlocals);
}
}
/* pass a proc for evaluation */
/* evaluate the bytecode */
result = mrb_vm_run(mrb,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment