From ac9173dd4bc7c93c057839badde2b116ee720fb8 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sat, 24 Mar 2018 18:02:53 -0700 Subject: 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. --- share/txr/stdlib/compiler.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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)))) -- cgit v1.2.3