diff options
author | Kaz Kylheku <kaz@kylheku.com> | 2018-04-01 23:03:31 -0700 |
---|---|---|
committer | Kaz Kylheku <kaz@kylheku.com> | 2018-04-01 23:03:31 -0700 |
commit | 6f30c1dc672c453b82794b621049ea6a3ae4c656 (patch) | |
tree | b96545bccaa418d288d9ae63efdc28f1e69cdc29 | |
parent | 4ebbd243bbc1433400eff02ea9c18dc7c4eb76ce (diff) | |
download | txr-6f30c1dc672c453b82794b621049ea6a3ae4c656.tar.gz txr-6f30c1dc672c453b82794b621049ea6a3ae4c656.tar.bz2 txr-6f30c1dc672c453b82794b621049ea6a3ae4c656.zip |
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.
-rw-r--r-- | share/txr/stdlib/compiler.tl | 2 |
1 files changed, 1 insertions, 1 deletions
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 |