From b5a307aa88f00a7dc935ea8edebc19ee92e8461c Mon Sep 17 00:00:00 2001 From: Yuichi Nishiwaki Date: Tue, 1 Apr 2014 11:40:36 +0900 Subject: [PATCH] error on macroexpanding circular objects --- src/macro.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/macro.c b/src/macro.c index c0e70845..dd92fba9 100644 --- a/src/macro.c +++ b/src/macro.c @@ -262,6 +262,10 @@ macroexpand_node(pic_state *pic, pic_value expr, struct pic_senv *senv, pic_valu pic_value car, v; xh_entry *e; + if (! pic_list_p(expr)) { + pic_errorf(pic, "cannot macroexpand improper list: ~s", expr); + } + car = macroexpand(pic, pic_car(pic, expr), senv, assoc_box); if (pic_sym_p(car)) { pic_sym tag = pic_sym(car);