segv if an error is raised when no exception handler is registered

This commit is contained in:
Yuichi Nishiwaki 2016-03-02 04:34:43 +09:00
parent 3feee82d8b
commit ce6dd55ea5
1 changed files with 8 additions and 0 deletions

View File

@ -172,6 +172,10 @@ pic_raise(pic_state *pic, pic_value err)
stack = pic_call(pic, exc, 0);
if (pic_nil_p(pic, stack)) {
pic_panic(pic, "no exception handler");
}
pic_dynamic_bind(pic, exc, pic_cdr(pic, stack), pic_lambda(pic, raise, 2, pic_car(pic, stack), err));
PIC_UNREACHABLE();
@ -192,6 +196,10 @@ pic_raise_continuable(pic_state *pic, pic_value err)
stack = pic_call(pic, exc, 0);
if (pic_nil_p(pic, stack)) {
pic_panic(pic, "no exception handler");
}
return pic_dynamic_bind(pic, exc, pic_cdr(pic, stack), pic_lambda(pic, raise_continuable, 2, pic_car(pic, stack), err));
}