conformance problem, since seems hard to construct useful code
where it matters.)
- b.
- * (defun foo (x)
- (declare (type (double-float -0d0) x))
- (declare (optimize speed))
- (+ x (sqrt (log (random 1d0)))))
- debugger invoked on condition of type SIMPLE-ERROR:
- bad thing to be a type specifier: ((COMPLEX
- (DOUBLE-FLOAT 0.0d0
- #.SB-EXT:DOUBLE-FLOAT-POSITIVE-INFINITY))
- #C(0.0d0 #.SB-EXT:DOUBLE-FLOAT-POSITIVE-INFINITY)
- #C(0.0d0 #.SB-EXT:DOUBLE-FLOAT-POSITIVE-INFINITY))
+ b. (fixed in 0.8.3.43)
146:
Floating point errors are reported poorly. E.g. on x86 OpenBSD
x86 LEA instruction for multiplication by constants.
* bug fix: in some situations compiler did not report usage of
generic arithmetic in (SPEED 3) policy.
+ * bug 145b fix: compiler used wrong type specifier while converting
+ MEMBER-types to numeric.
* fixed some bugs revealed by Paul Dietz' test suite:
** the RETURN clause in LOOP is now equivalent to DO (RETURN ...).
** ROUND and FROUND now give the right answer when given very
** optimizer for (EXPT X 0) did not work for X not of type FLOAT.
** (GCD 0 <negative-integer>) returned <negative-integer>.
** LCM should return a non-negative integer.
+ ** PARSE-INTEGER returned the index of a terminator instead of the
+ upper bounding index of a substring in case :JUNK-ALLOWED NIL.
+ ** PARSE-INTEGER returned an incorrect index being applied to a
+ displaced string.
planned incompatible changes in 0.8.x:
* (not done yet, but planned:) When the profiling interface settles
`(error 'simple-parse-error
:format-control ,format-control
:format-arguments (list string))))
- (with-array-data ((string string)
+ (with-array-data ((string string :offset-var offset)
(start start)
(end (%check-vector-sequence-bounds string start end)))
(let ((index (do ((i start (1+ i)))
found-digit t))
(junk-allowed (return nil))
((whitespacep char)
- (do ((jndex (1+ index) (1+ jndex)))
- ((= jndex end))
- (declare (fixnum jndex))
- (unless (whitespacep (char string jndex))
+ (loop
+ (incf index)
+ (when (= index end) (return))
+ (unless (whitespacep (char string index))
(parse-error "junk in string ~S")))
(return nil))
(t
(if junk-allowed
nil
(parse-error "no digits in string ~S")))
- index)))))
+ (- index offset))))))
\f
;;;; reader initialization code
;;; the high order bit is bit 31 because shifting by 32 doesn't work
;;; too well.
(defun ub32-strength-reduce-constant-multiply (arg num)
- (declare (type (unsigned-byte 32) numb))
+ (declare (type (unsigned-byte 32) num))
(let ((adds 0) (shifts 0)
(result nil) first-one)
(labels ((tub32 (x) `(truly-the (unsigned-byte 32) ,x))
(member (first members))
(member-type (type-of member)))
(aver (not (rest members)))
- (specifier-type `(,(if (subtypep member-type 'integer)
- 'integer
- member-type)
- ,member ,member))))
+ (specifier-type (cond ((typep member 'integer)
+ `(integer ,member ,member))
+ ((memq member-type '(short-float single-float
+ double-float long-float))
+ `(,member-type ,member ,member))
+ (t
+ member-type)))))
;;; This is used in defoptimizers for computing the resulting type of
;;; a function.
(funcall (eval ''list) y (+ y 2d0) (* y 3d0)))))
(assert (raises-error? (bug233a 4) type-error))
+;;; compiler failure
+(defun bug145b (x)
+ (declare (type (double-float -0d0) x))
+ (declare (optimize speed))
+ (+ x (sqrt (log (random 1d0)))))
\f
(sb-ext:quit :unix-status 104)
(handler-case (with-input-from-string (s "cl:") (read s))
(end-of-file (c)
'good))
- 'good))
\ No newline at end of file
+ 'good))
+
+;;; Bugs found by Paul Dietz
+(assert (equal (multiple-value-list
+ (parse-integer " 123 "))
+ '(123 12)))
+
+(let* ((base "xxx 123 yyy")
+ (intermediate (make-array 8 :element-type (array-element-type base)
+ :displaced-to base
+ :displaced-index-offset 2))
+ (string (make-array 6 :element-type (array-element-type base)
+ :displaced-to intermediate
+ :displaced-index-offset 1)))
+ (assert (equal (multiple-value-list
+ (parse-integer string))
+ '(123 6))))
;;; 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.46"
+"0.8.3.47"