Commit e02ff850 authored by jbreeden's avatar jbreeden

Null check for irep & initialize loc.lineno

parent 4f4fa0ad
......@@ -108,6 +108,8 @@ each_backtrace(mrb_state *mrb, mrb_int ciidx, mrb_code *pc0, each_backtrace_func
for (i = ciidx; i >= 0; i--) {
struct backtrace_location_raw loc;
loc.lineno = -1;
mrb_callinfo *ci;
mrb_irep *irep;
mrb_code *pc;
......@@ -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