Commit d8f10994 authored by dearblue's avatar dearblue

Allow rethrowing `MRB_TT_BREAK`

parent ccf7a824
......@@ -241,10 +241,15 @@ mrb_exc_set(mrb_state *mrb, mrb_value exc)
MRB_API mrb_noreturn void
mrb_exc_raise(mrb_state *mrb, mrb_value exc)
{
if (mrb_break_p(exc)) {
mrb->exc = mrb_obj_ptr(exc);
}
else {
if (!mrb_obj_is_kind_of(mrb, exc, mrb->eException_class)) {
mrb_raise(mrb, E_TYPE_ERROR, "exception object expected");
}
mrb_exc_set(mrb, exc);
}
if (!mrb->jmp) {
mrb_p(mrb, exc);
abort();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment