Check `lv` before printing local variable names.

parent 8b3f3c0b
......@@ -11,6 +11,7 @@ print_r(mrb_state *mrb, const mrb_irep *irep, size_t n)
{
if (n == 0) return;
if (n > irep->nlocals) return;
if (!irep->lv[n-1]) return;
printf(" R%d:%s", (int)n, mrb_sym_dump(mrb, irep->lv[n-1]));
}
......
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