From 5d04e3316bc96c0df6084c0bf6020e3038837ad3 Mon Sep 17 00:00:00 2001 From: "Yukihiro \"Matz\" Matsumoto" Date: Sat, 2 Dec 2017 01:08:48 +0900 Subject: Check if `ci->proc` is not `NULL` and `MRB_PROC_CFUNC_P()`; fix #3867 --- src/vm.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/vm.c b/src/vm.c index 15b25ecb0..5793e2f74 100644 --- a/src/vm.c +++ b/src/vm.c @@ -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; -- cgit v1.2.3