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
commit1c19f40086b23d28280334783679d00b119d8b61 (patch)
treee7571ff59a4a3a1c16c2eec61a2e5b8a1eae56a9
parent4815f528c228711623a9bcf3dd9626c044a16f45 (diff)
downloadtxr-1c19f40086b23d28280334783679d00b119d8b61.tar.gz
txr-1c19f40086b23d28280334783679d00b119d8b61.tar.bz2
txr-1c19f40086b23d28280334783679d00b119d8b61.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))