inline pic_try/pic_catch in with_exception_handler

This commit is contained in:
Yuichi Nishiwaki 2014-09-17 22:13:00 +09:00
parent a17e79a160
commit d33d0eee85
1 changed files with 8 additions and 2 deletions

10
error.c
View File

@ -180,10 +180,16 @@ pic_error_with_exception_handler(pic_state *pic)
pic_get_args(pic, "ll", &handler, &thunk); pic_get_args(pic, "ll", &handler, &thunk);
pic_try_with_handler(handler) { pic_push_try(pic, handler);
if (setjmp(*pic->jmp) == 0) {
val = pic_apply0(pic, thunk); val = pic_apply0(pic, thunk);
pic_pop_try(pic);
} }
pic_catch { else {
pic_pop_try(pic);
pic_value e = pic->err; pic_value e = pic->err;
pic->err = pic_undef_value(); pic->err = pic_undef_value();