summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-03-24 18:02:53 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-03-24 18:02:53 -0700
commitb887b0a46cb66f2f2bc1a67b13e115e57058f298 (patch)
treedbd389fd45bd057e1eae35421bd0084cf5b88416
parentea1e031c3902ed935e4685e0e1cd630e26c6875d (diff)
downloadtxr-b887b0a46cb66f2f2bc1a67b13e115e57058f298.tar.gz
txr-b887b0a46cb66f2f2bc1a67b13e115e57058f298.tar.bz2
txr-b887b0a46cb66f2f2bc1a67b13e115e57058f298.zip
compiler: fix wrong frame level in lexical functions.
* share/txr/stdlib/compiler.tl (sys:env extend-fun): The v register's level is two less than the frame level. Add missing ppred call; extend-var has it already.
-rw-r--r--share/txr/stdlib/compiler.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index f7f23039..d9c89bea 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -79,7 +79,7 @@
(:method extend-fun (me sym)
(when (assoc sym me.fb)
(compile-error me.co.last-form "duplicate function ~s" sym))
- (let* ((loc ^(v ,me.lev ,(pinc me.v-cntr)))
+ (let* ((loc ^(v ,(ppred me.lev) ,(pinc me.v-cntr)))
(bn (new binding sym sym loc loc env me)))
(set me.fb (acons sym bn me.fb))))