Support the case when the backtrace is not an array.

This commit is contained in:
Yukihiro "Matz" Matsumoto
2017-05-01 19:16:16 +09:00
parent a1ea2a670c
commit 497b19ce22
+1 -1
View File
@@ -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;