summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-05-26 21:00:38 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-05-26 21:00:38 -0700
commit766c1339633967bb15262113a200def51a40edb0 (patch)
tree2ef3d5f73c2f7811fe5df8b1f228f014e093024f
parent614f22045ed5c9fa96b1e74b3018ab1f116ea6e0 (diff)
downloadtxr-766c1339633967bb15262113a200def51a40edb0.tar.gz
txr-766c1339633967bb15262113a200def51a40edb0.tar.bz2
txr-766c1339633967bb15262113a200def51a40edb0.zip
compiler: fix broken block*.
Compiling a block* fails with an exception: nil is accessed as a structure. * share/txr/stdlib/compiler.tl (comp-block): when compiling block*, nenv is nil; we must use env when compiling the name subexpression. Also, we can't use nenv when compiling the body. We must use nenv when it is available (block case) or else fall back on env (block* case).
-rw-r--r--share/txr/stdlib/compiler.tl4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 98b3fc4a..d1f5c016 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -602,9 +602,9 @@
(binfo (unless star
(cdar nenv.(extend-block name))))
(treg (if star me.(maybe-alloc-treg oreg)))
- (nfrag (if star me.(compile treg nenv name)))
+ (nfrag (if star me.(compile treg env name)))
(nreg (if star nfrag.oreg me.(get-dreg name)))
- (bfrag me.(comp-progn oreg nenv body))
+ (bfrag me.(comp-progn oreg (or nenv env) body))
(lskip (gensym "l")))
(when treg
me.(maybe-free-treg treg oreg))