summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2019-08-26 06:57:40 -0700
committerKaz Kylheku <kaz@kylheku.com>2019-08-26 06:57:40 -0700
commite9e0ecdaea431aed31b8940bf8359f52ae5d3f6c (patch)
tree744729df8820fde6ebf30b1d0767e2224cc9d218
parente1d9261a6c0cacf922c7d189603bbd4bf0ba3017 (diff)
downloadtxr-e9e0ecdaea431aed31b8940bf8359f52ae5d3f6c.tar.gz
txr-e9e0ecdaea431aed31b8940bf8359f52ae5d3f6c.tar.bz2
txr-e9e0ecdaea431aed31b8940bf8359f52ae5d3f6c.zip
compiler: for: bugfix: dangling label reference.
An infinite for loop in which the test is explicitly given as nil rather than omitted fails to compile. A minimal repro test case for this is (compile-toplevel '(for () (nil) ()))). Spotted this while reading the compiler code. * share/txr/stdlib/compiler.tl (compiler comp-for): Test the test-p variable, not test, to determine whether or not to generate the loop skip label.
-rw-r--r--share/txr/stdlib/compiler.tl2
1 files changed, 1 insertions, 1 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 8756dba3..ec76f1dd 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -1097,7 +1097,7 @@
,*bfrag.code
,*nfrag.code
(jmp ,lback)
- ,*(if test
+ ,*(if test-p
^(,lskip
,*rfrag.code)))
[reduce-left uni frags nil .fvars]