summaryrefslogtreecommitdiffstats
path: root/eval.c
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2016-11-18 06:23:11 -0800
committerKaz Kylheku <kaz@kylheku.com>2016-11-18 06:23:11 -0800
commit9e77cfa7e863eb9320867749967a3b39fc54629c (patch)
tree377677a6057450e63e3a5fa9a2617d67761eb08e /eval.c
parent0bfa413c5c5c61d48e94a46e48e52fed46c5860a (diff)
downloadtxr-9e77cfa7e863eb9320867749967a3b39fc54629c.tar.gz
txr-9e77cfa7e863eb9320867749967a3b39fc54629c.tar.bz2
txr-9e77cfa7e863eb9320867749967a3b39fc54629c.zip
Bugfix in expansion-time progn reduction.
This was exposed by causing an issue in the multi-pass expansion strategy used in tagbody which shields macro forms from a global macro using a local macro. * eval.c (expand_progn): When calling constantp, pass the macro environment, as required, rather than nil. This was causing (go ...) forms in tagbody to be expanded in the global environment using the global go macro which unconditionally throws an error about an undefined label, rather than using the harmless local go macrolet.
Diffstat (limited to 'eval.c')
-rw-r--r--eval.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/eval.c b/eval.c
index 2bf3d694..b34b364f 100644
--- a/eval.c
+++ b/eval.c
@@ -2576,7 +2576,7 @@ static val expand_progn(val form, val menv)
return rlcp(cdr(ex_f), form);
}
- if ((symbolp(ex_f) || constantp(ex_f, nil)) && ex_r)
+ if ((symbolp(ex_f) || constantp(ex_f, menv)) && ex_r)
return rlcp(ex_r, form);
if (ex_f == f && ex_r == r)