summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2018-06-28 06:30:08 -0700
committerKaz Kylheku <kaz@kylheku.com>2018-06-28 06:30:08 -0700
commit272f761845522099208467223b74bdaefd4737e4 (patch)
treedb952992e725260b3b7f8cd3eb532e98c98d6ee1
parent525178581e263d109f4620f742714ab3679ddf14 (diff)
downloadtxr-272f761845522099208467223b74bdaefd4737e4.tar.gz
txr-272f761845522099208467223b74bdaefd4737e4.tar.bz2
txr-272f761845522099208467223b74bdaefd4737e4.zip
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.
-rw-r--r--share/txr/stdlib/awk.tl2
1 files changed, 1 insertions, 1 deletions
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])))))))