summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-03-02 07:34:45 -0800
committerKaz Kylheku <kaz@kylheku.com>2021-03-02 07:34:45 -0800
commitd714b3549720df0e4322fb3bf7e46208fcd89cce (patch)
treeb25f1517c896b8b3e0782b478ddfde85be6b2868
parent0a7247a382d3152be5fe4203312a85d0822c9e56 (diff)
downloadtxr-d714b3549720df0e4322fb3bf7e46208fcd89cce.tar.gz
txr-d714b3549720df0e4322fb3bf7e46208fcd89cce.tar.bz2
txr-d714b3549720df0e4322fb3bf7e46208fcd89cce.zip
compiler: fix use of nil instead of (t 0).
Though the assembler acceps nil as a synonym of (t 0), we have to be consistent. * share/txr/stdlib/compiler.tl (compiler comp-or): Don't use nil operand in ifq instruction: use (t 0). * share/txr/stdlib/optimize.tl (basic-blocks thread-jumps-block): Don't match ifq pattern with nil operand; match (t 0).
-rw-r--r--share/txr/stdlib/compiler.tl2
-rw-r--r--share/txr/stdlib/optimize.tl2
2 files changed, 2 insertions, 2 deletions
diff --git a/share/txr/stdlib/compiler.tl b/share/txr/stdlib/compiler.tl
index 6b1c1a17..e624970a 100644
--- a/share/txr/stdlib/compiler.tl
+++ b/share/txr/stdlib/compiler.tl
@@ -1161,7 +1161,7 @@
(pend frag.code
me.(maybe-mov treg frag.oreg))
(unless islast
- (add ^(ifq ,treg ,nil ,lout)))
+ (add ^(ifq ,treg (t 0) ,lout)))
(set fvars (uni fvars frag.fvars))
(set ffuns (uni ffuns frag.ffuns))))))))
me.(maybe-free-treg treg oreg)
diff --git a/share/txr/stdlib/optimize.tl b/share/txr/stdlib/optimize.tl
index 02354e25..813264df 100644
--- a/share/txr/stdlib/optimize.tl
+++ b/share/txr/stdlib/optimize.tl
@@ -289,7 +289,7 @@
(jmp @(and @jjlabel @(not @jlabel))) . @nil)
^(if ,reg ,jjlabel))
((@jlabel
- (ifq @reg nil @jjlabel) . @jrest)
+ (ifq @reg (t 0) @jjlabel) . @jrest)
(let ((xbl (if jrest
bb.(cut-block [bb.hash jlabel] jrest jinsns)
bb.(next-block [bb.hash jlabel]))))