The proc with top-level env must be 'proc-closure'; fix #3871

parent ae44e806
......@@ -2019,9 +2019,16 @@ RETRY_TRY_BLOCK:
if (!MRB_PROC_ENV_P(proc) || !MRB_ENV_STACK_SHARED_P(MRB_PROC_ENV(proc))) {
goto L_BREAK_ERROR;
}
if (MRB_PROC_ENV(proc)->cxt != mrb->c) {
else {
struct REnv *e = MRB_PROC_ENV(proc);
if (e == mrb->c->cibase->env && proc != mrb->c->cibase->proc) {
goto L_BREAK_ERROR;
}
if (e->cxt != mrb->c) {
goto L_BREAK_ERROR;
}
}
while (mrb->c->eidx > mrb->c->ci->epos) {
ecall_adjust();
}
......
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