summaryrefslogtreecommitdiffhomepage
path: root/src/error.c
diff options
context:
space:
mode:
authorYukihiro "Matz" Matsumoto <[email protected]>2016-11-28 09:52:57 +0900
committerYukihiro "Matz" Matsumoto <[email protected]>2016-11-28 09:52:57 +0900
commit9fc62d28d0e5738368571d70f1be191876e91d8b (patch)
tree5a8aa5c845d654a5de331ff2d9cd08c005f193d2 /src/error.c
parent27ceb848180463e66e080d13c3a96b1e56dbddbd (diff)
downloadmruby-9fc62d28d0e5738368571d70f1be191876e91d8b.tar.gz
mruby-9fc62d28d0e5738368571d70f1be191876e91d8b.zip
pre-allocate arena overflow error
Diffstat (limited to 'src/error.c')
-rw-r--r--src/error.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/error.c b/src/error.c
index 9ff570bf6..b24aed798 100644
--- a/src/error.c
+++ b/src/error.c
@@ -465,7 +465,7 @@ exception_call:
}
if (argc > 0) {
if (!mrb_obj_is_kind_of(mrb, mesg, mrb->eException_class))
- mrb_raise(mrb, E_TYPE_ERROR, "exception object expected");
+ mrb_raise(mrb, mrb->eException_class, "exception object expected");
if (argc > 2)
set_backtrace(mrb, mesg, argv[2]);
}
@@ -532,6 +532,9 @@ mrb_init_exception(mrb_state *mrb)
mrb->eStandardError_class = mrb_define_class(mrb, "StandardError", mrb->eException_class); /* 15.2.23 */
runtime_error = mrb_define_class(mrb, "RuntimeError", mrb->eStandardError_class); /* 15.2.28 */
mrb->nomem_err = mrb_obj_ptr(mrb_exc_new_str_lit(mrb, runtime_error, "Out of memory"));
+#ifdef MRB_GC_FIXED_ARENA
+ mrb->arena_err = mrb_obj_ptr(mrb_exc_new_str_lit(mrb, runtime_error, "arena overflow error"));
+#endif
script_error = mrb_define_class(mrb, "ScriptError", mrb->eException_class); /* 15.2.37 */
mrb_define_class(mrb, "SyntaxError", script_error); /* 15.2.38 */
mrb_define_class(mrb, "SystemStackError", exception);