From 5e6f6f85f4d560460f7c99cee7f7f1f6ecd71fab Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Mon, 6 Jul 2015 14:18:49 +0900 Subject: [PATCH] [bugfix] pic_load_point should restore pic->cc --- extlib/benz/cont.c | 3 +-- extlib/benz/include/picrin/error.h | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/extlib/benz/cont.c b/extlib/benz/cont.c index 46b5908c..5fb0b06a 100644 --- a/extlib/benz/cont.c +++ b/extlib/benz/cont.c @@ -79,6 +79,7 @@ pic_load_point(pic_state *pic, struct pic_cont *cont) pic->arena_idx = cont->arena_idx; pic->ip = cont->ip; pic->ptable = cont->ptable; + pic->cc = cont->prev; } static pic_value @@ -140,8 +141,6 @@ pic_callcc(pic_state *pic, struct pic_proc *proc) pic_save_point(pic, &cont); if (PIC_SETJMP(pic, cont.jmp)) { - pic->cc = pic->cc->prev; - return pic_values_by_list(pic, cont.results); } else { diff --git a/extlib/benz/include/picrin/error.h b/extlib/benz/include/picrin/error.h index b8de3442..2afd0f3a 100644 --- a/extlib/benz/include/picrin/error.h +++ b/extlib/benz/include/picrin/error.h @@ -44,7 +44,6 @@ struct pic_error *pic_make_error(pic_state *, pic_sym *, const char *, pic_list) } while (0); \ pic->cc = pic->cc->prev; \ } else { \ - pic->cc = pic->cc->prev; \ goto label; \ } \ } while (0); \