changes in sbcl-0.9.13 relative to sbcl-0.9.12:
* new feature: source path information is generated for macro-expansion
errors for use in IDE's like Slime (thanks to Helmut Eller)
+ * bug fix: calls to the compiler no longer modify *RANDOM-STATE*
changes in sbcl-0.9.12 relative to sbcl-0.9.11:
* minor incompatible change: in sbcl-0.9.11 (but not earlier
;;; DEFVARs for these come later, after we have enough stuff defined.
(declaim (special *wild-type* *universal-type* *empty-type*))
\f
+(defvar *type-random-state*)
+
;;; the base class for the internal representation of types
(def!struct (ctype (:conc-name type-)
(:constructor nil)
(enumerable nil :read-only t)
;; an arbitrary hash code used in EQ-style hashing of identity
;; (since EQ hashing can't be done portably)
- (hash-value (random #.(ash 1 15))
+ (hash-value (random #.(ash 1 15)
+ (if (boundp '*type-random-state*)
+ *type-random-state*
+ (setf *type-random-state*
+ (make-random-state))))
:type (and fixnum unsigned-byte)
:read-only t)
;; Can this object contain other types? A global property of our
(do-one-fill wrappers value))
(maybe-check-cache ncache)))))
\f
+(defvar *pcl-misc-random-state* (make-random-state))
+
;;; This is the heart of the cache filling mechanism. It implements
;;; the decisions about where entries are placed.
;;;
(when (>= osep limit)
(return-from find-free-cache-line (values primary nil)))
(when (cond ((= nsep limit) t)
- ((= nsep osep) (zerop (random 2)))
+ ((= nsep osep)
+ (zerop (random 2 *pcl-misc-random-state*)))
((> nsep osep) t)
(t nil))
;; See whether we can displace what is in this line so that we
;; which are the parameters of the new state, and get other
;; information from the lexical variables bound above.
(flet ((two-class (index w0 w1)
- (when (zerop (random 2)) (psetf w0 w1 w1 w0))
+ (when (zerop (random 2 *pcl-misc-random-state*))
+ (psetf w0 w1 w1 w0))
(dfun-update gf
#'make-two-class-accessor-dfun
ntype
(f (compile nil l)))
(assert (funcall f :good))
(assert (nth-value 1 (ignore-errors (funcall f 42)))))
+
+;;; Check that the compiler doesn't munge *RANDOM-STATE*.
+(let* ((state (make-random-state))
+ (*random-state* (make-random-state state))
+ (a (random most-positive-fixnum)))
+ (setf *random-state* state)
+ (compile nil `(lambda (x a)
+ (declare (single-float x)
+ (type (simple-array double-float) a))
+ (+ (loop for i across a
+ summing i)
+ x)))
+ (assert (= a (random most-positive-fixnum))))
;;; 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.9.12.2"
+"0.9.12.3"