Permalink
Browse files

Call exc_debug_info() in mrb_exc_set(); ref #3610

Otherwise line number information is lacked from exceptions
raised in VM, e.g. "super called outside of method".
  • Loading branch information...
matz committed Apr 18, 2017
1 parent 82ab461 commit 05fceb5992c20c30a6b31f89d2b0aa0f0698a9a2
Showing with 4 additions and 4 deletions.
  1. +4 −4 src/error.c
View
@@ -291,6 +291,10 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
}
else {
mrb->exc = mrb_obj_ptr(exc);
if (!mrb->gc.out_of_memory) {
exc_debug_info(mrb, mrb->exc);
mrb_save_backtrace(mrb);
}
}
}
@@ -301,10 +305,6 @@ mrb_exc_raise(mrb_state *mrb, mrb_value exc)
mrb_raise(mrb, E_TYPE_ERROR, "exception object expected");
}
mrb_exc_set(mrb, exc);
if (!mrb->gc.out_of_memory) {
exc_debug_info(mrb, mrb->exc);
mrb_save_backtrace(mrb);
}
if (!mrb->jmp) {
mrb_p(mrb, exc);
abort();

0 comments on commit 05fceb5

Please sign in to comment.