Print errors by calling mrb_print_backtrace() without backtrace

- In case of `NoMemoryError` exceptions, the error message is now printed directly.
- Replaced `mrb_p()` used by #4250 with `mrb_print_error()`.

  ref. squashed commit f1523d2404
  ref. subcommit da7d7f881b
  ref. subcommit d9c7b6be6e
This commit is contained in:
dearblue
2022-11-20 20:58:03 +09:00
parent 3a0e2255bd
commit 61b60273ea
2 changed files with 18 additions and 9 deletions
+2 -2
View File
@@ -195,7 +195,7 @@ static mrb_noreturn void
exc_throw(mrb_state *mrb, mrb_value exc)
{
if (!mrb->jmp) {
mrb_p(mrb, exc);
mrb_print_error(mrb);
abort();
}
MRB_THROW(mrb->jmp);
@@ -576,7 +576,7 @@ mrb_core_init_protect(mrb_state *mrb, void (*body)(mrb_state *, void *), void *o
err = 0;
} MRB_CATCH(&c_jmp) {
if (mrb->exc) {
mrb_p(mrb, mrb_obj_value(mrb->exc));
mrb_print_error(mrb);
mrb->exc = NULL;
}
else {