summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2020-01-28 22:05:13 -0800
committerKaz Kylheku <kaz@kylheku.com>2020-01-28 22:05:13 -0800
commit0be217eeda907af469f4002b61b1f4f33aa19b4f (patch)
treee7571ff59a4a3a1c16c2eec61a2e5b8a1eae56a9
parent1ee1c572f9335dc75aab033fae4e54643ead8486 (diff)
downloadtxr-0be217eeda907af469f4002b61b1f4f33aa19b4f.tar.gz
txr-0be217eeda907af469f4002b61b1f4f33aa19b4f.tar.bz2
txr-0be217eeda907af469f4002b61b1f4f33aa19b4f.zip
compiler: bug in catch: frame level mismatch.
* share/txr/stdlib/compiler.tl (compiler comp-catch): Compile the try expression and the description in the newly extended environment rather than the original environment. This is necessary because the compiled code for both of these is is placed into the frame level corresponding to the new environment. Other than the level, the only difference between the two environment is that nenv has a couple of gensyms. Thus it is hygienic w.r.t. the try and desc code; the extended environment can safely be used.
-rw-r--r--share/txr/stdlib/compiler.tl4
1 files changed, 2 insertions, 2 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 44f276f5..a1e43a25 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -667,8 +667,8 @@
(let* ((nenv (new env up env co me))
(esvb (cdar nenv.(extend-var ex-sym-var)))
(eavb (cdar nenv.(extend-var ex-args-var)))
- (tfrag me.(compile oreg env try-expr))
- (dfrag me.(compile oreg env desc-expr))
+ (tfrag me.(compile oreg nenv try-expr))
+ (dfrag me.(compile oreg nenv desc-expr))
(lhand (gensym "l"))
(lhend (gensym "l"))
(treg me.(alloc-treg))