0.8.18.35:
authorAlexey Dejneka <adejneka@comail.ru>
Tue, 18 Jan 2005 04:34:55 +0000 (04:34 +0000)
committerAlexey Dejneka <adejneka@comail.ru>
Tue, 18 Jan 2005 04:34:55 +0000 (04:34 +0000)
        * Fix overflow in DATA-VECTOR-SET-C VOPs for simple bit
          vectors on X86 (reported by Timmy Douglas).

NEWS
src/compiler/x86/array.lisp
tests/compiler.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index ac0ca2e..0d05ab9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,6 +25,8 @@ changes in sbcl-0.8.19 relative to sbcl-0.8.18:
   * bug fixed: functions with &REST arguments sometimes failed with
     "Undefined function" when compiled with (DEBUG 3). (reported by
     Robert J. Macomber)
+  * bug fix: overflow during compiling of setting element of a bit
+    vector with constant index and value. (reported by Timmy Douglas)
   * build fix: fixed the dependence on *LOAD-PATHNAME* and
     *COMPILE-FILE-PATHNAME* being absolute pathnames.
   * on x86 compiler partially supports stack allocation of dynamic-extent
index a0983c2..2cd1d08 100644 (file)
                       (mask ,(1- (ash 1 bits)))
                       (shift (* extra ,bits)))
                  (unless (= value mask)
-                   (inst and old (lognot (ash mask shift))))
+                   (inst and old (ldb (byte 32 0) (lognot (ash mask shift)))))
                  (unless (zerop value)
                    (inst or old (ash value shift)))))
               (unsigned-reg
index 6dd5498..b9dacd9 100644 (file)
                         (with-simple-restart (blah "blah") (error "blah"))))))
   (handler-bind ((error (lambda (c) (invoke-restart 'blah))))
     (assert (equal (multiple-value-list (funcall f)) '(nil t)))))
+
+;;; Bug reported by Timmy Douglas: overflow in bit vector setter with
+;;; constant index and value.
+(let* ((n (* 2 sb-vm::n-word-bits))
+       (array1 (make-array n :element-type 'bit))
+       (array2 (make-array n :element-type 'bit)))
+  (dotimes (i n)
+    (dotimes (v 2)
+      (let ((f (compile nil `(lambda (a)
+                               (declare (type (simple-array bit (,n)) a))
+                               (setf (bit a ,i) ,v)))))
+        (fill array1 (- 1 v))
+        (fill array2 (- 1 v))
+        (funcall f array1)
+        (setf (aref array2 i) v)
+        (assert (equal array1 array2))))))
index 518eb48..4dc871a 100644 (file)
@@ -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.18.34"
+"0.8.18.35"