Commit d800c563 authored by ehuelsmann@1c010e3e-69d0-11dd-93a8-456734b0d56f's avatar ehuelsmann@1c010e3e-69d0-11dd-93a8-456734b0d56f
Browse files

Close #189: Fix thinko in MIN and MAX return value type derivation.

parent 5a983a31
......@@ -5247,7 +5247,8 @@ for use with derive-type-times.")
(define-int-bounds-derivation max (low1 low2 high1 high2)
(values (or (when (and low1 low2) (max low1 low2)) low1 low2)
(or (when (and high1 high2) (max high1 high2)) high1 high2)))
; if either maximum is unbound, their maximum is unbound
(when (and high1 high2) (max high1 high2))))
(declaim (ftype (function (t) t) derive-type-max))
(defun derive-type-max (form)
......@@ -5256,7 +5257,8 @@ for use with derive-type-times.")
(derive-compiler-types args op)))
(define-int-bounds-derivation min (low1 high1 low2 high2)
(values (or (when (and low1 low2) (min low1 low2)) low1 low2)
(values (when (and low1 low2) (min low1 low2))
; if either minimum is unbound, their minimum is unbound
(or (when (and high1 high2) (min high1 high2)) high1 high2)))
(defknown derive-type-min (t) t)
......
......@@ -473,10 +473,12 @@
t)
;;; ticket #189
(deftest compiler.3
(eql (funcall (compile nil (lambda (a)
(declare (type unsigned-byte a))
(max 28105919 a 1016934843)))
10545160975)
10545160975)
t)
\ No newline at end of file
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment