Permalink
Browse files

Check backtrace info may not be set (esp. NoMemError); fix #3663

  • Loading branch information...
matz committed May 25, 2017
1 parent 5e1a6a2 commit e969229b77b9c3b1f6ff4de7d9ce6d15586a9c15
Showing with 2 additions and 0 deletions.
  1. +2 −0 src/backtrace.c
View
@@ -138,6 +138,7 @@ mrb_print_backtrace(mrb_state *mrb)
}
backtrace = mrb_obj_iv_get(mrb, mrb->exc, mrb_intern_lit(mrb, "backtrace"));
if (mrb_nil_p(backtrace)) return;
if (mrb_array_p(backtrace)) {
print_backtrace(mrb, backtrace);
}
@@ -198,6 +199,7 @@ mrb_unpack_backtrace(mrb_state *mrb, mrb_value backtrace)
struct backtrace_location *bt;
mrb_int n, i;
if (mrb_nil_p(backtrace)) return mrb_ary_new_capa(mrb, 0);
if (mrb_array_p(backtrace)) return backtrace;
if (!mrb_string_p(backtrace)) {
broken:

0 comments on commit e969229

Please sign in to comment.