Check if ci->proc is not NULL and MRB_PROC_CFUNC_P(); fix #3867

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-12-02 01:08:48 +09:00
parent ff8b608c52
commit 5d04e3316b
+2 -1
View File
@@ -327,7 +327,8 @@ ecall(mrb_state *mrb)
mrb_assert(!MRB_PROC_CFUNC_P(p));
c->ensure[i] = NULL;
nregs = p->upper->body.irep->nregs;
if (ci->proc->body.irep->nregs > nregs) {
if (ci->proc && !MRB_PROC_CFUNC_P(ci->proc) &&
ci->proc->body.irep->nregs > nregs) {
nregs = ci->proc->body.irep->nregs;
}
cioff = ci - c->cibase;