Commit ac4b9fc8 authored by Raymond Toy's avatar Raymond Toy
Browse files

Merge branch 'rtoy-fix-61-62-not-flushable' into 'master'

Complex array accessors are not foldable

Closes #61 and #62

See merge request cmucl/cmucl!38
parents 771fd903 e9a598e5
Loading
Loading
Loading
Loading
+8 −5
Original line number Diff line number Diff line
@@ -252,29 +252,32 @@
		:ref-known (flushable foldable)
		:set-trans (setf %array-fill-pointer)
		:set-known (unsafe))
  ;; Don't let these ref-trans to be constant-folded because these
  ;; might get called on arrays that don't have these slots. (Because
  ;; the lisp functions might be inlined.)
  (fill-pointer-p :type (member t nil)
		  :ref-trans %array-fill-pointer-p
		  :ref-known (flushable foldable)
		  :ref-known (flushable)
		  :set-trans (setf %array-fill-pointer-p)
		  :set-known (unsafe))
  (elements :type index
	    :ref-trans %array-available-elements
	    :ref-known (flushable foldable)
	    :ref-known (flushable)
	    :set-trans (setf %array-available-elements)
	    :set-known (unsafe))
  (data :type array
	:ref-trans %array-data-vector
	:ref-known (flushable foldable)
	:ref-known (flushable)
	:set-trans (setf %array-data-vector)
	:set-known (unsafe))
  (displacement :type (or index null)
		:ref-trans %array-displacement
		:ref-known (flushable foldable)
		:ref-known (flushable)
		:set-trans (setf %array-displacement)
		:set-known (unsafe))
  (displaced-p :type (member t nil)
	       :ref-trans %array-displaced-p
	       :ref-known (flushable foldable)
	       :ref-known (flushable)
	       :set-trans (setf %array-displaced-p)
	       :set-known (unsafe))
  (dimensions :rest-p t))
+2 −0
Original line number Diff line number Diff line
@@ -35,6 +35,8 @@ public domain.
    * ~~#59~~ Incorrect type-derivation for `decode-float`
    * ~~#60~~ The function `C::%UNARY-FROUND` is undefined
    * ~~#58~~ Bogus type error in comparison of complex number with `THE` form
    * ~~#61~~ Segfault when compiling call to `ARRAY-HAS-FILL-POINTER-P` on bit vector constant
    * ~~#62~~ Segfault when compiling `ARRAY-DISPLACEMENT` on a string constant
  * Other changes:
  * Improvements to the PCL implementation of CLOS:
  * Changes to building procedure:
+14 −0
Original line number Diff line number Diff line
@@ -521,3 +521,17 @@
  (let ((c9 (compile nil #'(lambda (x)
			     (= (the (eql 1.0d0) x) #c(1/2 1/2))))))
    (assert-false (funcall c9 1.d0))))

(define-test issue.61
  (:tag :issues)
  ;; Verifies that the compiler doesn't segfault and that we return
  ;; the correct value.
  (assert-false
   (funcall (compile nil '(lambda () (array-has-fill-pointer-p #*10))))))

(define-test issue.62
  (:tag :issues)
  ;; Verifies that the compiler doesn't segfault and that we return
  ;; the correct value.
  (assert-false
   (funcall (compile nil '(lambda () (array-displacement "aaaaaaaa"))))))