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 | 46f881d72fd379c05574b527b4d89fac051928d3 (patch) | |
tree | b96545bccaa418d288d9ae63efdc28f1e69cdc29 | |
parent | 49243654bffac57fb8b49d88c7cfb60a4150edbc (diff) | |
download | txr-46f881d72fd379c05574b527b4d89fac051928d3.tar.gz txr-46f881d72fd379c05574b527b4d89fac051928d3.tar.bz2 txr-46f881d72fd379c05574b527b4d89fac051928d3.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 |