Clear `env` before top-level execution; fix #4581

parent 2a410c0e
...@@ -2834,6 +2834,7 @@ mrb_top_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int sta ...@@ -2834,6 +2834,7 @@ mrb_top_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int sta
return mrb_vm_run(mrb, proc, self, stack_keep); return mrb_vm_run(mrb, proc, self, stack_keep);
} }
if (mrb->c->ci == mrb->c->cibase) { if (mrb->c->ci == mrb->c->cibase) {
mrb->c->ci->env = NULL;
return mrb_vm_run(mrb, proc, self, stack_keep); return mrb_vm_run(mrb, proc, self, stack_keep);
} }
ci = cipush(mrb); ci = cipush(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