mirror of
https://github.com/mruby/mruby
synced 2026-06-08 16:11:16 +00:00
use SystemStackError instead of RuntimeError
This commit is contained in:
@@ -385,6 +385,7 @@ void mrb_print_error(mrb_state *mrb);
|
||||
#define E_SYNTAX_ERROR (mrb_class_get(mrb, "SyntaxError"))
|
||||
#define E_LOCALJUMP_ERROR (mrb_class_get(mrb, "LocalJumpError"))
|
||||
#define E_REGEXP_ERROR (mrb_class_get(mrb, "RegexpError"))
|
||||
#define E_SYSSTACK_ERROR (mrb_class_get(mrb, "SystemStackError"))
|
||||
|
||||
#define E_NOTIMP_ERROR (mrb_class_get(mrb, "NotImplementedError"))
|
||||
#define E_FLOATDOMAIN_ERROR (mrb_class_get(mrb, "FloatDomainError"))
|
||||
|
||||
@@ -455,4 +455,5 @@ mrb_init_exception(mrb_state *mrb)
|
||||
mrb->nomem_err = mrb_obj_ptr(mrb_exc_new_str(mrb, runtime_error, mrb_str_new_lit(mrb, "Out of memory")));
|
||||
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);
|
||||
}
|
||||
|
||||
@@ -160,7 +160,7 @@ stack_extend_alloc(mrb_state *mrb, int room, int keep)
|
||||
to prevent infinite recursion. However, do this only after resizing the stack, so mrb_raise has stack space to work with. */
|
||||
if (size > MRB_STACK_MAX) {
|
||||
init_new_stack_space(mrb, room, keep);
|
||||
mrb_raise(mrb, E_RUNTIME_ERROR, "stack level too deep. (limit=" TO_STR(MRB_STACK_MAX) ")");
|
||||
mrb_raise(mrb, E_SYSSTACK_ERROR, "stack level too deep. (limit=" TO_STR(MRB_STACK_MAX) ")");
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user