mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
need addtional type check to avoid SEGV; ref #2609
This commit is contained in:
@@ -12,7 +12,11 @@ get_closure_irep(mrb_state *mrb, int level)
|
||||
struct RProc *proc;
|
||||
|
||||
if (level == 0) {
|
||||
return mrb->c->ci[-1].proc->body.irep;
|
||||
proc = mrb->c->ci[-1].proc;
|
||||
if (MRB_PROC_CFUNC_P(proc)) {
|
||||
return NULL;
|
||||
}
|
||||
return proc->body.irep;
|
||||
}
|
||||
|
||||
while (--level) {
|
||||
|
||||
Reference in New Issue
Block a user