From af0b589e45a86862ac81b59c24cb6d6b6e955d5a Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Fri, 1 Dec 2006 16:32:13 +0000 Subject: [PATCH] 1.0.0.7: Fix an off-by-one in the x86-64 FIXNUMP/UNSIGNED-BYTE-64 VOP (patch from Lutz Euler). --- src/compiler/x86-64/type-vops.lisp | 2 +- tests/type.pure.lisp | 13 ++++++++++--- version.lisp-expr | 2 +- 3 files changed, 12 insertions(+), 5 deletions(-) diff --git a/src/compiler/x86-64/type-vops.lisp b/src/compiler/x86-64/type-vops.lisp index f3b540fdb..c052211aa 100644 --- a/src/compiler/x86-64/type-vops.lisp +++ b/src/compiler/x86-64/type-vops.lisp @@ -190,7 +190,7 @@ (:temporary (:sc unsigned-reg) tmp) (:generator 5 (inst mov tmp value) - (inst shr tmp 61) + (inst shr tmp n-positive-fixnum-bits) (inst jmp (if not-p :nz :z) target))) ;;; A (SIGNED-BYTE 64) can be represented with either fixnum or a bignum with diff --git a/tests/type.pure.lisp b/tests/type.pure.lisp index 46a4bd643..07ad60d76 100644 --- a/tests/type.pure.lisp +++ b/tests/type.pure.lisp @@ -377,6 +377,13 @@ ACTUAL ~D DERIVED ~D~%" (check-type (car a) integer)) (assert (eql (car a) 1)))) - - - +;;; The VOP FIXNUMP/UNSIGNED-BYTE-64 was broken on x86-64, failing +;;; the first ASSERT below. The second ASSERT takes care that the fix +;;; doesn't overshoot the mark. +(with-test (:name (:typep :fixnum-if-unsigned-byte)) + (let ((f (compile nil + (lambda (x) + (declare (type (unsigned-byte #.sb-vm:n-word-bits) x)) + (typep x (quote fixnum)))))) + (assert (not (funcall f (1+ most-positive-fixnum)))) + (assert (funcall f most-positive-fixnum)))) diff --git a/version.lisp-expr b/version.lisp-expr index 989243756..740ee6379 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".) -"1.0.0.6" +"1.0.0.7" -- 2.11.4.GIT