Skip to content
This repository has been archived by the owner on Mar 26, 2024. It is now read-only.

Commit

Permalink
segv if an error is raised when no exception handler is registered
Browse files Browse the repository at this point in the history
  • Loading branch information
nyuichi committed Mar 1, 2016
1 parent 3feee82 commit ce6dd55
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions extlib/benz/error.c
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand All @@ -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));
}

Expand Down

0 comments on commit ce6dd55

Please sign in to comment.