diff options
| author | take_cheeze <[email protected]> | 2014-02-25 18:47:28 +0900 |
|---|---|---|
| committer | take_cheeze <[email protected]> | 2014-03-01 20:05:29 +0900 |
| commit | 78915f96017a12e8c3c40a4a2714543c10d0d070 (patch) | |
| tree | 9db022c63ebd09aec5d1164141a0bdb85cc93d3f /src/error.c | |
| parent | 5ff9c1d2861609fc98f03ec2d768e0b4f1559a09 (diff) | |
| download | mruby-78915f96017a12e8c3c40a4a2714543c10d0d070.tar.gz mruby-78915f96017a12e8c3c40a4a2714543c10d0d070.zip | |
support c++ exception
Diffstat (limited to 'src/error.c')
| -rw-r--r-- | src/error.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/error.c b/src/error.c index db516d766..f7e5995e6 100644 --- a/src/error.c +++ b/src/error.c @@ -15,6 +15,7 @@ #include "mruby/variable.h" #include "mruby/debug.h" #include "mruby/error.h" +#include "mrb_throw.h" mrb_value mrb_exc_new(mrb_state *mrb, struct RClass *c, const char *ptr, long len) @@ -221,7 +222,7 @@ mrb_exc_raise(mrb_state *mrb, mrb_value exc) mrb_p(mrb, exc); abort(); } - mrb_longjmp(mrb); + MRB_THROW(mrb->jmp); } void @@ -431,6 +432,10 @@ mrb_sys_fail(mrb_state *mrb, const char *mesg) } } +#ifdef MRB_ENABLE_CXX_EXCEPTION +mrb_int mrb_jmpbuf::jmpbuf_id = 0; +#endif + void mrb_init_exception(mrb_state *mrb) { |
