From 272f761845522099208467223b74bdaefd4737e4 Mon Sep 17 00:00:00 2001 From: Kaz Kylheku Date: Thu, 28 Jun 2018 06:30:08 -0700 Subject: awk: bugfix: block optimized away by compiler. This breaks the (next) awk macro, breaking awk expressions which want to short-circuit to the next record. * share/txr/stdlib/awk.tl (sys:awk-state loop): The :awk-rec block is being optimized away by the compiler because it doesn't contain any direct function calls to functions that are not in the standard library. We must use block*, which isn't subject to this optimization. --- share/txr/stdlib/awk.tl | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/share/txr/stdlib/awk.tl b/share/txr/stdlib/awk.tl index a0e2a39e..b4f6c8c8 100644 --- a/share/txr/stdlib/awk.tl +++ b/share/txr/stdlib/awk.tl @@ -175,7 +175,7 @@ (set aws.rec rec aws.orig-rec rec) (inc aws.rec-num) (inc aws.file-rec-num) - (while* (eq :awk-again (block :awk-rec [func aws])) + (while* (eq :awk-again (block* :awk-rec [func aws])) aws.(rec-to-f))) (when end-file-func [end-file-func aws]))))))) -- cgit v1.2.3