raise-continuable broken
This commit is contained in:
parent
0111cd19ed
commit
a38ba15010
11
src/error.c
11
src/error.c
|
@ -180,19 +180,18 @@ static pic_value
|
||||||
pic_error_raise_continuable(pic_state *pic)
|
pic_error_raise_continuable(pic_state *pic)
|
||||||
{
|
{
|
||||||
pic_value v;
|
pic_value v;
|
||||||
size_t i;
|
|
||||||
|
|
||||||
pic_get_args(pic, "o", &v);
|
pic_get_args(pic, "o", &v);
|
||||||
|
|
||||||
if (pic->try_jmps->handler == NULL) {
|
if (pic->try_jmp_idx == 0) {
|
||||||
pic_errorf(pic, "uncontinuable exception handler is on top");
|
|
||||||
}
|
|
||||||
if ((i = pic->try_jmp_idx) == 0) {
|
|
||||||
pic_errorf(pic, "no exception handler registered");
|
pic_errorf(pic, "no exception handler registered");
|
||||||
}
|
}
|
||||||
|
if (pic->try_jmps[pic->try_jmp_idx - 1].handler == NULL) {
|
||||||
|
pic_errorf(pic, "uncontinuable exception handler is on top");
|
||||||
|
}
|
||||||
else {
|
else {
|
||||||
pic->try_jmp_idx--;
|
pic->try_jmp_idx--;
|
||||||
v = pic_apply1(pic, pic->try_jmps->handler, v);
|
v = pic_apply1(pic, pic->try_jmps[pic->try_jmp_idx].handler, v);
|
||||||
++pic->try_jmp_idx;
|
++pic->try_jmp_idx;
|
||||||
}
|
}
|
||||||
return v;
|
return v;
|
||||||
|
|
Loading…
Reference in New Issue