summaryrefslogtreecommitdiffstats
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
commit1088f838942ad396448f6402980cfc1462d5f100 (patch)
tree377677a6057450e63e3a5fa9a2617d67761eb08e
parent613b03c235693932c49fe37062d3585689e688ab (diff)
downloadtxr-1088f838942ad396448f6402980cfc1462d5f100.tar.gz
txr-1088f838942ad396448f6402980cfc1462d5f100.tar.bz2
txr-1088f838942ad396448f6402980cfc1462d5f100.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.
-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)