summaryrefslogtreecommitdiffstats
path: root/stdlib
diff options
context:
space:
mode:
authorKaz Kylheku <kaz@kylheku.com>2021-11-02 07:12:51 -0700
committerKaz Kylheku <kaz@kylheku.com>2021-11-02 07:12:51 -0700
commit15e1c259cfe7a961b97cbd4ca3e148f22554e832 (patch)
tree440d73ce1019dd0a817aa566773287c92d8dadd4 /stdlib
parent1e11f341609e614c0268c792658c95063a92ac75 (diff)
downloadtxr-15e1c259cfe7a961b97cbd4ca3e148f22554e832.tar.gz
txr-15e1c259cfe7a961b97cbd4ca3e148f22554e832.tar.bz2
txr-15e1c259cfe7a961b97cbd4ca3e148f22554e832.zip
compiler: bug: invalid transformation of (- x y ...).
* stdlib/compiler.tl (compiler comp-arith-neg-form): Remove algebraically incorrect transformation.
Diffstat (limited to 'stdlib')
-rw-r--r--stdlib/compiler.tl8
1 files changed, 2 insertions, 6 deletions
diff --git a/stdlib/compiler.tl b/stdlib/compiler.tl
index ae64266b..5330161d 100644
--- a/stdlib/compiler.tl
+++ b/stdlib/compiler.tl
@@ -1265,12 +1265,8 @@
(tree-bind (nop . args) form
(let ((op (caseq nop (- '+) (/ '*)))
(a1 (car args)))
- (if (and (eq nop '-)
- (constantp a1))
- me.(comp-arith-form oreg env
- ^(,op (- ,a1) ,*(cdr args)))
- me.(comp-fun-form oreg env
- ^(,nop ,(car args) (,op ,*(cdr args)))))))
+ me.(comp-fun-form oreg env
+ ^(,nop ,(car args) (,op ,*(cdr args))))))
me.(comp-fun-form oreg env form)))
(defmeth compiler comp-fun-form (me oreg env form)