Permalink
Browse files

Clear top level env in `mrb_top_run()`; fix #3643

  • Loading branch information...
matz committed May 25, 2017
1 parent f88cb88 commit ed16535c73b9eb763e445e23489e7a73144f6f09
Showing with 5 additions and 1 deletion.
  1. +5 −1 src/vm.c
View
@@ -2740,7 +2740,11 @@ mrb_top_run(mrb_state *mrb, struct RProc *proc, mrb_value self, unsigned int sta
mrb_callinfo *ci;
mrb_value v;
if (!mrb->c->cibase || mrb->c->ci == mrb->c->cibase) {
if (!mrb->c->cibase) {
return mrb_vm_run(mrb, proc, self, stack_keep);
}
if (mrb->c->ci == mrb->c->cibase) {
mrb->c->ci->env = NULL;
return mrb_vm_run(mrb, proc, self, stack_keep);
}
ci = cipush(mrb);

0 comments on commit ed16535

Please sign in to comment.