Skip to content

Commit

Permalink
Call exc_debug_info() in mrb_exc_set(); ref #3610
Browse files Browse the repository at this point in the history
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 05fceb5
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
}
}

Expand All @@ -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();
Expand Down

0 comments on commit 05fceb5

Please sign in to comment.