From 6f30c1dc672c453b82794b621049ea6a3ae4c656 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Sun, 1 Apr 2018 23:03:31 -0700 Subject: compiler: bugfix: wrong lambda frame size. * share/txr/stdlib/compiler.tl (compiler comp-lambda): We must not deduce the frame size from the nenv v-counter, because in the case when no frame is needed (the function has no arguments), nenv is just env. Our need-frame variable indicates whether or not a frame is needed; if not, we must use size zero. This is crucial because the VM otherwise ends up throwing an exception due to the frame level mismatch. --- 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 943ae461..e60286c0 100644 --- a/share/txr/stdlib/compiler.tl +++ b/share/txr/stdlib/compiler.tl @@ -695,7 +695,7 @@ (bfrag me.(comp-progn btreg benv body)) (boreg (if env.(out-of-scope bfrag.oreg) btreg bfrag.oreg)) (lskip (gensym "l-")) - (frsize nenv.v-cntr)) + (frsize (if need-frame nenv.v-cntr 0))) me.(free-treg btreg) (new (frag oreg ^((close ,oreg ,frsize ,lskip ,nfixed ,nreq -- cgit v1.2.3