From a193af3bef2412ee5e11d5f296b097ea6641b476 Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Wed, 10 Sep 2014 15:20:36 +0900 Subject: [PATCH] deal with exceptions inside macroexpansion --- macro.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/macro.c b/macro.c index d34482d3..ec627215 100644 --- a/macro.c +++ b/macro.c @@ -358,8 +358,6 @@ pic_macroexpand(pic_state *pic, pic_value expr, struct pic_lib *lib) struct pic_lib *prev; pic_value v; - assert(pic_eq_p(lib->env->defer, pic_nil_value())); - #if DEBUG puts("before expand:"); pic_debug(pic, expr); @@ -370,6 +368,8 @@ pic_macroexpand(pic_state *pic, pic_value expr, struct pic_lib *lib) prev = pic->lib; pic->lib = lib; + lib->env->defer = pic_nil_value(); /* the last expansion could fail and leave defer field old */ + v = macroexpand(pic, expr, lib->env); macroexpand_deferred(pic, lib->env);