Skip to content

Commit ed16535

Browse files
committed
Clear top level env in mrb_top_run(); fix #3643
1 parent f88cb88 commit ed16535

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

src/vm.c

+5-1
Original file line numberDiff line numberDiff line change
@@ -2740,7 +2740,11 @@ mrb_top_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int sta
27402740
mrb_callinfo *ci;
27412741
mrb_value v;
27422742

2743-
if (!mrb->c->cibase || mrb->c->ci == mrb->c->cibase) {
2743+
if (!mrb->c->cibase) {
2744+
return mrb_vm_run(mrb, proc, self, stack_keep);
2745+
}
2746+
if (mrb->c->ci == mrb->c->cibase) {
2747+
mrb->c->ci->env = NULL;
27442748
return mrb_vm_run(mrb, proc, self, stack_keep);
27452749
}
27462750
ci = cipush(mrb);

0 commit comments

Comments
 (0)