context proc may be cfunc; fix #2609

parent c5a23e6a
......@@ -23,6 +23,9 @@ get_closure_irep(mrb_state *mrb, int level)
if (!e) return NULL;
proc = mrb->c->cibase[e->cioff].proc;
if (MRB_PROC_CFUNC_P(proc)) {
return NULL;
}
return proc->body.irep;
}
......@@ -34,7 +37,7 @@ search_variable(mrb_state *mrb, mrb_sym vsym, int bnest)
int pos;
for (level = 0; (virep = get_closure_irep(mrb, level)); level++) {
if (virep->lv == NULL) {
if (!virep || virep->lv == NULL) {
continue;
}
for (pos = 0; pos < virep->nlocals - 1; pos++) {
......
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