From 01d48c687a1f7c2a5c191b1b0de4ffab3132dd71 Mon Sep 17 00:00:00 2001 From: Christophe Rhodes Date: Wed, 10 Sep 2003 13:21:29 +0000 Subject: [PATCH] 0.8.3.48: (SIGNED-BYTE 1) = (INTEGER -1 0) ... detected by random input from pfdietz, noted on #lisp 2003-09-10 --- src/code/deftypes-for-target.lisp | 2 +- tests/compiler.pure.lisp | 9 +++++++++ version.lisp-expr | 2 +- 3 files changed, 11 insertions(+), 2 deletions(-) diff --git a/src/code/deftypes-for-target.lisp b/src/code/deftypes-for-target.lisp index 0928858..0559ce2 100644 --- a/src/code/deftypes-for-target.lisp +++ b/src/code/deftypes-for-target.lisp @@ -33,7 +33,7 @@ (sb!xc:deftype signed-byte (&optional s) (cond ((eq s '*) 'integer) - ((and (integerp s) (> s 1)) + ((and (integerp s) (> s 0)) (let ((bound (ash 1 (1- s)))) `(integer ,(- bound) ,(1- bound)))) (t diff --git a/tests/compiler.pure.lisp b/tests/compiler.pure.lisp index 433b520..f9c418f 100644 --- a/tests/compiler.pure.lisp +++ b/tests/compiler.pure.lisp @@ -562,3 +562,12 @@ (fun (compile nil src)) (result (1+ (funcall (eval #'*) x real-zero)))) (assert (eql result (funcall fun x))))))) + +;;; (SIGNED-BYTE 1) [ returned from the logxor derive-type optimizer ] +;;; wasn't recognized as a good type specifier. +(let ((fun (lambda (x y) + (declare (type (integer -1 0) x y) (optimize speed)) + (logxor x y)))) + (assert (= (funcall fun 0 0) 0)) + (assert (= (funcall fun 0 -1) -1)) + (assert (= (funcall fun -1 -1) 0))) diff --git a/version.lisp-expr b/version.lisp-expr index 14d6bf7..63abc32 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -17,4 +17,4 @@ ;;; checkins which aren't released. (And occasionally for internal ;;; versions, especially for internal versions off the main CVS ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".) -"0.8.3.47" +"0.8.3.48" -- 1.7.10.4