From e9e0ecdaea431aed31b8940bf8359f52ae5d3f6c Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Mon, 26 Aug 2019 06:57:40 -0700 Subject: 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. --- share/txr/stdlib/compiler.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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] -- cgit v1.2.3