Fixed a bug in typed Scheme's optimizer when using binary arithmetic
operators in a unary fashion with floats.
This commit is contained in:
parent
664ef2c0a3
commit
762f108c04
|
@ -60,11 +60,11 @@
|
||||||
(begin (log-optimization "unary float" #'op)
|
(begin (log-optimization "unary float" #'op)
|
||||||
#'(op.unsafe f.opt)))
|
#'(op.unsafe f.opt)))
|
||||||
;; unlike their safe counterparts, unsafe binary operators can only take 2 arguments
|
;; unlike their safe counterparts, unsafe binary operators can only take 2 arguments
|
||||||
(pattern (#%plain-app op:float-binary-op f fs ...)
|
(pattern (#%plain-app op:float-binary-op f1 f2 fs ...)
|
||||||
#:with opt
|
#:with opt
|
||||||
(begin (log-optimization "binary float" #'op)
|
(begin (log-optimization "binary float" #'op)
|
||||||
(for/fold ([o #'f.opt])
|
(for/fold ([o #'f1.opt])
|
||||||
([e (syntax->list #'(fs.opt ...))])
|
([e (syntax->list #'(f2.opt fs.opt ...))])
|
||||||
#`(op.unsafe #,o #,e))))
|
#`(op.unsafe #,o #,e))))
|
||||||
(pattern (#%plain-app op:pair-unary-op p)
|
(pattern (#%plain-app op:pair-unary-op p)
|
||||||
#:with opt
|
#:with opt
|
||||||
|
|
Loading…
Reference in New Issue
Block a user