mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
Do not raise an exception for living closure; ref #3359
This commit is contained in:
@@ -1828,7 +1828,7 @@ RETRY_TRY_BLOCK:
|
||||
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 @@ RETRY_TRY_BLOCK:
|
||||
|
||||
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) {
|
||||
|
||||
Reference in New Issue
Block a user