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
commit6ad1aa9978b219f34799ae9db41e20452d06145f (patch)
tree2ef3d5f73c2f7811fe5df8b1f228f014e093024f
parent30b5b23616152d3603b1e1ff3158aba8c93eab48 (diff)
downloadtxr-6ad1aa9978b219f34799ae9db41e20452d06145f.tar.gz
txr-6ad1aa9978b219f34799ae9db41e20452d06145f.tar.bz2
txr-6ad1aa9978b219f34799ae9db41e20452d06145f.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))