Check if irep is NULL before print_backtrace()

According to the valgrind log attached to #3438, proc->body.irep
may be NULL in some cases.
parent af4d74fc
...@@ -118,6 +118,7 @@ each_backtrace(mrb_state *mrb, mrb_int ciidx, mrb_code *pc0, each_backtrace_func ...@@ -118,6 +118,7 @@ each_backtrace(mrb_state *mrb, mrb_int ciidx, mrb_code *pc0, each_backtrace_func
if (MRB_PROC_CFUNC_P(ci->proc)) continue; if (MRB_PROC_CFUNC_P(ci->proc)) continue;
irep = ci->proc->body.irep; irep = ci->proc->body.irep;
if (!irep) continue;
if (mrb->c->cibase[i].err) { if (mrb->c->cibase[i].err) {
pc = mrb->c->cibase[i].err; pc = mrb->c->cibase[i].err;
......
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