From cbf6b1f32c09868cb76af8f8b47fa157e6f5eb1f Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Fri, 25 Nov 2016 23:31:30 -0800 Subject: bugfix: dohash expander not making shadowing env. * eval.c (do_expand): When a dohash special form is expanded, a macro shadowing environment must be created for the two variables that it binds and the body must be expanded in that environment, to protect the variables from symbol macros. --- eval.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/eval.c b/eval.c index 74713d72..a5f74b5a 100644 --- a/eval.c +++ b/eval.c @@ -3785,7 +3785,8 @@ static val do_expand(val form, val menv) val body = rest(rest(form)); val hashform_ex = expand(hashform, menv); val resform_ex = expand(resform, menv); - val body_ex = expand_progn(body, menv); + val new_menv = make_var_shadowing_env(menv, list(keysym, valsym, nao)); + val body_ex = expand_progn(body, new_menv); if (hashform == hashform_ex && resform == resform_ex && body == body_ex) return form; -- cgit v1.2.3