Skip to content

Commit 418a19b

Browse files
committed
Type check dimension in make-array
1 parent 4fe625c commit 418a19b

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

lisp/l/array.l

+3-2
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@
9999
(setq entity (instantiate element-type dim))
100100
(setq a entity)
101101
(setq dim (list dim)))
102-
(t
102+
((consp dim)
103103
(setq a (instantiate array))
104104
(let* ((i 0)
105105
(rank (length dim))
@@ -120,7 +120,8 @@
120120
(setf (array-displaced-index-offset a) displaced-index-offset)
121121
(do ((i 0 (1+ i)))
122122
((>= i rank))
123-
(setslot a array (+ i 5) (elt dim i))))))
123+
(setslot a array (+ i 5) (elt dim i)))))
124+
(t (error "integer or list expected")))
124125
(when initial-element (fill entity initial-element))
125126
(when initial-contents
126127
(fill-initial-contents entity 0 dim initial-contents))

0 commit comments

Comments
 (0)