mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
context proc may be cfunc; fix #2609
This commit is contained in:
@@ -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++) {
|
||||
|
||||
Reference in New Issue
Block a user