[armedbear-cvs] r14143 - in trunk/abcl: src/org/armedbear/lisp test/lisp/abcl

ehuelsmann at common-lisp.net ehuelsmann at common-lisp.net
Sat Sep 1 21:00:51 UTC 2012


Author: ehuelsmann
Date: Sat Sep  1 14:00:49 2012
New Revision: 14143

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

Modified:
   trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
   trunk/abcl/test/lisp/abcl/compiler-tests.lisp

Modified: trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp
==============================================================================
--- trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp	Sat Sep  1 13:59:40 2012	(r14142)
+++ trunk/abcl/src/org/armedbear/lisp/compiler-pass2.lisp	Sat Sep  1 14:00:49 2012	(r14143)
@@ -5247,7 +5247,8 @@
 
 (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 @@
     (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)

Modified: trunk/abcl/test/lisp/abcl/compiler-tests.lisp
==============================================================================
--- trunk/abcl/test/lisp/abcl/compiler-tests.lisp	Sat Sep  1 13:59:40 2012	(r14142)
+++ trunk/abcl/test/lisp/abcl/compiler-tests.lisp	Sat Sep  1 14:00:49 2012	(r14143)
@@ -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




More information about the armedbear-cvs mailing list