Skip to content

Commit

Permalink
0.8.18.35:
Browse files Browse the repository at this point in the history
        * Fix overflow in DATA-VECTOR-SET-C VOPs for simple bit
          vectors on X86 (reported by Timmy Douglas).
  • Loading branch information
Alexey Dejneka committed Jan 18, 2005
1 parent 9f71619 commit a74b61e
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 2 deletions.
2 changes: 2 additions & 0 deletions NEWS
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion src/compiler/x86/array.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -260,7 +260,7 @@
(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
Expand Down
16 changes: 16 additions & 0 deletions tests/compiler.pure.lisp
Original file line number Diff line number Diff line change
Expand Up @@ -1675,3 +1675,19 @@
(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))))))
2 changes: 1 addition & 1 deletion version.lisp-expr
Original file line number Diff line number Diff line change
Expand Up @@ -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"

0 comments on commit a74b61e

Please sign in to comment.