bugfix: forgot to change with_exception_handlers in prev^2 commit

This commit is contained in:
Yuichi Nishiwaki
2017-04-25 21:52:39 +09:00
parent 94a350ad83
commit 4ceee54fa7
2 changed files with 9 additions and 4 deletions
+8 -3
View File
@@ -127,9 +127,14 @@ pic_make_error(pic_state *pic, const char *type, const char *msg, pic_value irrs
static pic_value
with_exception_handlers(pic_state *pic, pic_value handlers, pic_value thunk)
{
pic_value alist, var = pic_exc(pic);
alist = pic_list(pic, 1, pic_cons(pic, var, handlers));
return pic_funcall(pic, "with-dynamic-environment", 2, alist, thunk);
pic_value var, env, r;
var = pic_exc(pic);
env = pic_make_weak(pic);
pic_weak_set(pic, env, var, handlers);
pic->dyn_env = pic_cons(pic, env, pic->dyn_env);
r = pic_call(pic, thunk, 0);
pic->dyn_env = pic_cdr(pic, pic->dyn_env);
return r;
}
static pic_value