Skip to content
Snippets Groups Projects
Commit a3257f4d authored by dtc's avatar dtc
Browse files

Fix array-displacement to correctly handle non-displaced arrays; it

wasn't even checking that the array had a header causing random data
to be returned when passed a simple-array. Ndote by Sam Steingold,
with suggestions from Raymond Toy.
parent 5882bb5a
No related branches found
No related tags found
No related merge requests found
...@@ -5,7 +5,7 @@ ...@@ -5,7 +5,7 @@
;;; Carnegie Mellon University, and has been placed in the public domain. ;;; Carnegie Mellon University, and has been placed in the public domain.
;;; ;;;
(ext:file-comment (ext:file-comment
"$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/array.lisp,v 1.29 1998/07/24 17:17:49 dtc Exp $") "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/array.lisp,v 1.30 2000/05/12 20:54:36 dtc Exp $")
;;; ;;;
;;; ********************************************************************** ;;; **********************************************************************
;;; ;;;
...@@ -583,7 +583,10 @@ ...@@ -583,7 +583,10 @@
"Returns values of :displaced-to and :displaced-index-offset options to "Returns values of :displaced-to and :displaced-index-offset options to
make-array, or the defaults nil and 0 if not a displaced array." make-array, or the defaults nil and 0 if not a displaced array."
(declare (array array)) (declare (array array))
(values (%array-data-vector array) (%array-displacement array))) (if (and (array-header-p array) (%array-displaced-p array))
(values (%array-data-vector array)
(truly-the fixnum (%array-displacement array)))
(values nil 0)))
(defun adjustable-array-p (array) (defun adjustable-array-p (array)
"Returns T if (adjust-array array...) would return an array identical "Returns T if (adjust-array array...) would return an array identical
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment