cmp: fix compiler-macro for make-array

Constant arguments for the dimensions were not handled correctly. The
valid-array-index function was lost in a refactor some time ago.
Moreover, we need to check all of the conditions on the
dimensions (limits on rank, dimension and total size) using an AND
statement instead of checking only the first condition using OR.
This commit is contained in:
Marius Gerbershagen 2025-03-02 19:02:28 +01:00
parent 31bcb06d83
commit 270b3a4157

View file

@ -34,9 +34,10 @@
(list dimensions))
((and (listp dimensions)
(let ((rank (list-length dimensions)))
(or (numberp rank)
(< -1 rank array-rank-limit)
(every #'valid-array-index dimensions))))
(and (numberp rank)
(< -1 rank array-rank-limit)
(every #'(lambda (x) (typep x 'ext:array-index)) dimensions)
(< (apply '* dimensions) array-total-size-limit))))
dimensions)
(t
(cmpwarn "The first argument to MAKE-ARRAY~%~A~%is not a valid set of dimensions" orig-dimensions)