diff options
Diffstat (limited to 'src/error.c')
| -rw-r--r-- | src/error.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/src/error.c b/src/error.c index bd3afd2e1..df4bbc866 100644 --- a/src/error.c +++ b/src/error.c @@ -5,7 +5,6 @@ */ #include <errno.h> -#include <setjmp.h> #include <stdarg.h> #include <stdlib.h> #include <string.h> @@ -147,7 +146,8 @@ exc_inspect(mrb_state *mrb, mrb_value exc) if (!mrb_nil_p(mesg) && RSTRING_LEN(mesg) > 0) { mrb_str_cat(mrb, str, ": ", 2); mrb_str_append(mrb, str, mesg); - } else { + } + else { mrb_str_cat(mrb, str, ": ", 2); mrb_str_cat_cstr(mrb, str, mrb_obj_classname(mrb, exc)); } @@ -218,7 +218,7 @@ mrb_exc_raise(mrb_state *mrb, mrb_value exc) mrb_p(mrb, exc); abort(); } - longjmp(*(jmp_buf*)mrb->jmp, 1); + mrb_longjmp(mrb); } void @@ -425,10 +425,12 @@ mrb_sys_fail(mrb_state *mrb, const char *mesg) sce = mrb_class_get(mrb, "SystemCallError"); if (mesg != NULL) { mrb_funcall(mrb, mrb_obj_value(sce), "_sys_fail", 2, mrb_fixnum_value(no), mrb_str_new_cstr(mrb, mesg)); - } else { + } + else { mrb_funcall(mrb, mrb_obj_value(sce), "_sys_fail", 1, mrb_fixnum_value(no)); } - } else { + } + else { mrb_raise(mrb, E_RUNTIME_ERROR, mesg); } } |
