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
commit651f19b9c774863156682272cb3bc5f392540096 (patch)
tree744729df8820fde6ebf30b1d0767e2224cc9d218
parent6055b9712b3896861e65d009886ad4d03e5d50d6 (diff)
downloadtxr-651f19b9c774863156682272cb3bc5f392540096.tar.gz
txr-651f19b9c774863156682272cb3bc5f392540096.tar.bz2
txr-651f19b9c774863156682272cb3bc5f392540096.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]