summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-25 23:31:30 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-25 23:31:30 -0800
commitcbf6b1f32c09868cb76af8f8b47fa157e6f5eb1f (patch)
treea6ba83cb2de8abad9a65e82b25b37c547e57c94b
parent2ead17138dfea8df5dccaf72eca2c47629880086 (diff)
downloadtxr-cbf6b1f32c09868cb76af8f8b47fa157e6f5eb1f.tar.gz
txr-cbf6b1f32c09868cb76af8f8b47fa157e6f5eb1f.tar.bz2
txr-cbf6b1f32c09868cb76af8f8b47fa157e6f5eb1f.zip
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.
-rw-r--r--eval.c3
1 files changed, 2 insertions, 1 deletions
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;