From a38ba15010e8284725a3656dbc73dcabd4e5292f Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Thu, 24 Jul 2014 11:45:28 +0900 Subject: [PATCH] raise-continuable broken --- src/error.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/error.c b/src/error.c index 782062a6..971a0b47 100644 --- a/src/error.c +++ b/src/error.c @@ -180,19 +180,18 @@ static pic_value pic_error_raise_continuable(pic_state *pic) { pic_value v; - size_t i; pic_get_args(pic, "o", &v); - if (pic->try_jmps->handler == NULL) { - pic_errorf(pic, "uncontinuable exception handler is on top"); - } - if ((i = pic->try_jmp_idx) == 0) { + if (pic->try_jmp_idx == 0) { 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 { 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; } return v;