Permalink
Browse files

Support the case when the backtrace is not an array.

  • Loading branch information...
matz committed May 1, 2017
1 parent a1ea2a6 commit 497b19ce22e2c48339695b8a9943c21db2f2a7dd
Showing with 1 addition and 1 deletion.
  1. +1 −1 src/error.c
View
@@ -174,7 +174,7 @@ exc_get_backtrace(mrb_state *mrb, mrb_value exc)
attr_name = mrb_intern_lit(mrb, "backtrace");
backtrace = mrb_iv_get(mrb, exc, attr_name);
if (mrb_nil_p(backtrace)) {
if (!mrb_array_p(backtrace)) {
if (mrb_obj_ptr(exc) == mrb->backtrace.exc && mrb->backtrace.n > 0) {
backtrace = mrb_restore_backtrace(mrb);
mrb->backtrace.n = 0;

0 comments on commit 497b19c

Please sign in to comment.