From cfff13b268daf51fd05214b60e67a2b62f340d16 Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Thu, 28 Apr 2005 22:20:40 +0000 Subject: [PATCH] 0.9.0.3: Fix a few leakages from the host environment that only mattered when the host compiler had a larger fixnum size than the target. Building a 32-bit SBCL with a 64-bit SBCL as host should now work. * COMPACT-INFO-LOOKUP FIXME fixed by LOGANDing the return-value of GLOBALDB-SXHASHOID with SB!XC:MOST-POSITIVE-FIXNUM * Some !constants (LAYOUT-CLOS-HASH-MAX, CALL-ARGUMENTS-LIMIT, etc) were derived from MOST-POSITIVE-FIXNUM. Use SB!XC:MOST-POSITIVE-FIXNUM instead. --- NEWS | 4 ++++ src/code/class.lisp | 2 +- src/compiler/early-c.lisp | 6 +++--- src/compiler/globaldb.lisp | 38 +++++++++++++------------------------- version.lisp-expr | 2 +- 5 files changed, 22 insertions(+), 30 deletions(-) diff --git a/NEWS b/NEWS index 1ddc538..1658f72 100644 --- a/NEWS +++ b/NEWS @@ -1,3 +1,7 @@ +changes in sbcl-0.9.1 relative to sbcl-0.9.0: + * fixed cross-compiler leakages that prevented building a 32-bit + target with a 64-bit host compiler. + changes in sbcl-0.9.0 relative to sbcl-0.8.21: * incompatible change: the --noprogrammer option, deprecated since version 0.7.5, has been removed. Please use the equivalent diff --git a/src/code/class.lisp b/src/code/class.lisp index 535914c..c41894e 100644 --- a/src/code/class.lisp +++ b/src/code/class.lisp @@ -84,7 +84,7 @@ ;;; Note: This bound is set somewhat less than MOST-POSITIVE-FIXNUM ;;; in order to guarantee that several hash values can be added without ;;; overflowing into a bignum. -(def!constant layout-clos-hash-max (ash most-positive-fixnum -3) +(def!constant layout-clos-hash-max (ash sb!xc:most-positive-fixnum -3) #!+sb-doc "the inclusive upper bound on LAYOUT-CLOS-HASH values") diff --git a/src/compiler/early-c.lisp b/src/compiler/early-c.lisp index 11f7176..2d2444f 100644 --- a/src/compiler/early-c.lisp +++ b/src/compiler/early-c.lisp @@ -16,16 +16,16 @@ (in-package "SB!C") ;;; ANSI limits on compilation -(def!constant sb!xc:call-arguments-limit most-positive-fixnum +(def!constant sb!xc:call-arguments-limit sb!xc:most-positive-fixnum #!+sb-doc "The exclusive upper bound on the number of arguments which may be passed to a function, including &REST args.") -(def!constant sb!xc:lambda-parameters-limit most-positive-fixnum +(def!constant sb!xc:lambda-parameters-limit sb!xc:most-positive-fixnum #!+sb-doc "The exclusive upper bound on the number of parameters which may be specifed in a given lambda list. This is actually the limit on required and &OPTIONAL parameters. With &KEY and &AUX you can get more.") -(def!constant sb!xc:multiple-values-limit most-positive-fixnum +(def!constant sb!xc:multiple-values-limit sb!xc:most-positive-fixnum #!+sb-doc "The exclusive upper bound on the number of multiple VALUES that you can return.") diff --git a/src/compiler/globaldb.lisp b/src/compiler/globaldb.lisp index 221210d..70aefce 100644 --- a/src/compiler/globaldb.lisp +++ b/src/compiler/globaldb.lisp @@ -54,18 +54,19 @@ ;;; aren't used too early in cold boot for SXHASH to run). #!-sb-fluid (declaim (inline globaldb-sxhashoid)) (defun globaldb-sxhashoid (x) - (cond ((symbolp x) (sxhash x)) - ((and (listp x) - (eq (first x) 'setf) - (let ((rest (rest x))) - (and (symbolp (car rest)) - (null (cdr rest))))) - ;; We need to declare the type of the value we're feeding to - ;; SXHASH so that the DEFTRANSFORM on symbols kicks in. - (let ((symbol (second x))) - (declare (symbol symbol)) - (logxor (sxhash symbol) 110680597))) - (t (sxhash x)))) + (logand sb!xc:most-positive-fixnum + (cond ((symbolp x) (sxhash x)) + ((and (listp x) + (eq (first x) 'setf) + (let ((rest (rest x))) + (and (symbolp (car rest)) + (null (cdr rest))))) + ;; We need to declare the type of the value we're feeding to + ;; SXHASH so that the DEFTRANSFORM on symbols kicks in. + (let ((symbol (second x))) + (declare (symbol symbol)) + (logxor (sxhash symbol) 110680597))) + (t (sxhash x))))) ;;; Given any non-negative integer, return a prime number >= to it. ;;; @@ -550,18 +551,6 @@ ;;; GLOBALDB-SXHASHOID of NAME. (defun compact-info-lookup (env name hash) (declare (type compact-info-env env) - ;; FIXME: this used to read (TYPE INDEX HASH), but that was - ;; wrong, because HASH was a positive fixnum, not a (MOD - ;; MOST-POSITIVE-FIXNUM). - ;; - ;; However, this, its replacement, is also wrong. In the - ;; cross-compiler, GLOBALDB-SXHASHOID is essentially - ;; SXHASH. But our host compiler could have any value at - ;; all as its MOST-POSITIVE-FIXNUM, and so could in - ;; principle return a value exceeding our target positive - ;; fixnum range. - ;; - ;; My brain hurts. -- CSR, 2003-08-28 (type (integer 0 #.sb!xc:most-positive-fixnum) hash)) (let* ((table (compact-info-env-table env)) (len (length table)) @@ -725,7 +714,6 @@ ;;; Just like COMPACT-INFO-LOOKUP, only do it on a volatile environment. (defun volatile-info-lookup (env name hash) (declare (type volatile-info-env env) - ;; FIXME: see comment in COMPACT-INFO-LOOKUP (type (integer 0 #.sb!xc:most-positive-fixnum) hash)) (let ((table (volatile-info-env-table env))) (macrolet ((lookup (test) diff --git a/version.lisp-expr b/version.lisp-expr index e735e52..ae81130 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".) -"0.9.0.2" +"0.9.0.3" -- 1.7.10.4