Commit e3f68bde authored by Christophe Rhodes's avatar Christophe Rhodes
Browse files

0.8.4.36:

	Fix bug 213a
	... CONS-TYPE-LENGTH-INFO to walk CONS-TYPE lists
	... delete the neat but ultimately flawed (CONS NIL T) test
		and use a proper test instead
	... test suite additions.
	Add idea from Michael Hudson (sbcl-devel 2003-08-26) to exit
		early from Darwin compilations when the stack size
		limit is too small.
parent 9b87691b
Loading
Loading
Loading
Loading
+1 −5
Original line number Diff line number Diff line
@@ -727,11 +727,7 @@ WORKAROUND:
  all of the arguments are circular is probably desireable).

213: "Sequence functions and type checking"
  a. MAKE-SEQUENCE, COERCE, MERGE and CONCATENATE cannot deal with
     various complicated, though recognizeable, CONS types [e.g.
       (CONS * (CONS * NULL))
     which according to ANSI should be recognized] (and, in SAFETY 3
     code, should return a list of LENGTH 2 or signal an error)
  a. (fixed in 0.8.4.36)
  b. MAP, when given a type argument that is SUBTYPEP LIST, does not
     check that it will return a sequence of the given type.  Fixing
     it along the same lines as the others (cf. work done around
+3 −0
Original line number Diff line number Diff line
@@ -2129,6 +2129,9 @@ changes in sbcl-0.8.5 relative to sbcl-0.8.4:
  * bug fix: LOOP forms using NIL as a for-as-arithmetic counter no
    longer raise an error; further, using a list as a for-as-arithmetic
    counter now raises a meaningful error.
  * fixed bug 213a: even fairly unreasonable CONS type specifiers are
    now understood by sequence creation functions such as MAKE-SEQUENCE
    and COERCE.
  * compiler enhancement: SIGNUM is now better able to derive the type
    of its result.
  * type declarations inside WITH-SLOTS are checked.  (reported by
+8 −0
Original line number Diff line number Diff line
@@ -178,6 +178,14 @@ elif [ "$sbcl_arch" = "ppc" -a "$sbcl_os" = "linux" ]; then
    # versions 2.3.1 and 2.3.2
    $GNUMAKE -C tools-for-build where-is-mcontext
    tools-for-build/where-is-mcontext > src/runtime/ppc-linux-mcontext.h
elif [ "$sbcl_arch" = "ppc" -a "$sbcl_os" = "darwin" ]; then
    # The default stack ulimit under darwin is too small to run PURIFY.
    # Best we can do is complain and exit at this stage
    if [ $(ulimit -s) = "512" ]; then
        echo "Your stack size limit is too small to build SBCL."
        echo "See the limit(1) or ulimit(1) commands and the README file."
        exit 1
    fi
else
    # Nothing need be done in this case, but sh syntax wants a placeholder.
    echo > /dev/null
+19 −12
Original line number Diff line number Diff line
@@ -203,17 +203,24 @@
	      res))))
	((csubtypep type (specifier-type 'list))
	 (if (vectorp object)
	     (cond ((type= type (specifier-type 'list))
	     (cond
	       ((type= type (specifier-type 'list))
		(vector-to-list* object))
	       ((type= type (specifier-type 'null))
		(if (= (length object) 0)
		    'nil
		    (sequence-type-length-mismatch-error type
							 (length object))))
		   ((csubtypep (specifier-type '(cons nil t)) type)
		    (if (> (length object) 0)
			(vector-to-list* object)
			(sequence-type-length-mismatch-error type 0)))
	       ((cons-type-p type)
		(multiple-value-bind (min exactp)
		    (sb!kernel::cons-type-length-info type)
		  (let ((length (length object)))
		    (if exactp
			(unless (= length min)
			  (sequence-type-length-mismatch-error type length))
			(unless (>= length min)
			  (sequence-type-length-mismatch-error type length)))
		    (vector-to-list* object))))
	       (t (sequence-type-too-hairy (type-specifier type))))
	     (coerce-error)))
	((csubtypep type (specifier-type 'vector))
+18 −0
Original line number Diff line number Diff line
@@ -460,6 +460,24 @@
	  (eq cdr-type *empty-type*))
      *empty-type*
      (%make-cons-type car-type cdr-type)))

(defun cons-type-length-info (type)
  (declare (type cons-type type))
  (do ((min 1 (1+ min))
       (cdr (cons-type-cdr-type type) (cons-type-cdr-type cdr)))
      ((not (cons-type-p cdr))
       (cond
	 ((csubtypep cdr (specifier-type 'null))
	  (values min t))
	 ((csubtypep *universal-type* cdr)
	  (values min nil))
	 ((type/= (type-intersection (specifier-type 'cons) cdr) *empty-type*)
	  (values min nil))
	 ((type/= (type-intersection (specifier-type 'null) cdr) *empty-type*)
	  (values min t))
	 (t (values min :maybe))))
    ()))
       

;;;; type utilities

Loading