Commit bf7719fe authored by Yukihiro "Matz" Matsumoto's avatar Yukihiro "Matz" Matsumoto

Merge pull request #3126 from jbreeden/backtrace_irep_null_check

Null check for irep & initialize loc.lineno
parents 4f4fa0ad d2a8f7e0
......@@ -112,6 +112,8 @@ each_backtrace(mrb_state *mrb, mrb_int ciidx, mrb_code *pc0, each_backtrace_func
mrb_irep *irep;
mrb_code *pc;
loc.lineno = -1;
ci = &mrb->c->cibase[i];
if (!ci->proc) continue;
......@@ -128,8 +130,11 @@ each_backtrace(mrb_state *mrb, mrb_int ciidx, mrb_code *pc0, each_backtrace_func
else {
pc = pc0;
}
if (irep) {
loc.filename = mrb_debug_get_filename(irep, (uint32_t)(pc - irep->iseq));
loc.lineno = mrb_debug_get_line(irep, (uint32_t)(pc - irep->iseq));
}
if (loc.lineno == -1) continue;
......
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