Permalink
Browse files

Do not raise an exception for living closure; ref #3359

  • Loading branch information...
matz committed Apr 20, 2017
1 parent 6a0b68f commit edd9fc6e75e26e154ab6af5c504f3bd38ecbfdd3
Showing with 10 additions and 2 deletions.
  1. +10 −2 src/vm.c
View
@@ -1828,7 +1828,7 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
ci = mrb->c->ci;
break;
case OP_R_BREAK:
if (ci->acc < 0 || !proc->env || !MRB_ENV_STACK_SHARED_P(proc->env)) {
if (!proc->env || !MRB_ENV_STACK_SHARED_P(proc->env)) {
mrb_value exc;
L_BREAK_ERROR:
@@ -1843,8 +1843,16 @@ mrb_vm_exec(mrb_state *mrb, struct RProc *proc, mrb_code *pc)
mrb->c = c->prev;
c->prev = NULL;
ci = mrb->c->ci;
}
if (ci->acc < 0) {
while (eidx > mrb->c->ci[-1].eidx) {
ecall(mrb, --eidx);
}
mrb->c->vmexec = FALSE;
mrb->jmp = prev_jmp;
return v;
}
ci = mrb->c->ci;
mrb->c->stack = ci->stackent;
mrb->c->ci = mrb->c->cibase + proc->env->cioff + 1;
while (ci > mrb->c->ci) {

0 comments on commit edd9fc6

Please sign in to comment.