From: Christophe R. <cr...@us...> - 2003-09-12 15:23:14
|
Update of /cvsroot/sbcl/sbcl/tests In directory sc8-pr-cvs1:/tmp/cvs-serv9659/tests Modified Files: arith.pure.lisp Log Message: 0.8.3.56: Fix (BYTE 0 0) ... again, in the %LDB-and-friends DERIVE-TYPE methods, but this time the failure seemed more justifiable, because... ... (UNSIGNED-BYTE 0) is quite naturally interpreted as (INTEGER 0 0), and that's what we wrote, but ... ... ANSI saith "s---a positive integer". Ugh. So ... ... implement SB!INT:UNSIGNED-BYTE* that does the right thing, and use it to simplify derive-type logic. Index: arith.pure.lisp =================================================================== RCS file: /cvsroot/sbcl/sbcl/tests/arith.pure.lisp,v retrieving revision 1.15 retrieving revision 1.16 diff -u -d -r1.15 -r1.16 --- arith.pure.lisp 12 Sep 2003 09:16:54 -0000 1.15 +++ arith.pure.lisp 12 Sep 2003 15:23:08 -0000 1.16 @@ -145,3 +145,11 @@ (let ((f (compile nil '(lambda (b) (integer-length (deposit-field b (byte 4 28) -1005)))))) (assert (= (funcall f 1230070) 32))) + +;;; type inference leading to an internal compiler error: +(let ((f (compile nil '(lambda (x) + (declare (type fixnum x)) + (ldb (byte 0 0) x))))) + (assert (= (funcall f 1) 0)) + (assert (= (funcall f most-positive-fixnum) 0)) + (assert (= (funcall f -1) 0))) |