From 973aaff528f1ca907eba848fc3aae7ad1bc9b90a Mon Sep 17 00:00:00 2001 From: Guilherme Affonso Date: Tue, 2 Apr 2019 22:55:38 +0900 Subject: [PATCH] Type check dimension in make-array --- lisp/l/array.l | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/lisp/l/array.l b/lisp/l/array.l index e7bc5b7e0..ae75995c0 100644 --- a/lisp/l/array.l +++ b/lisp/l/array.l @@ -99,7 +99,7 @@ (setq entity (instantiate element-type dim)) (setq a entity) (setq dim (list dim))) - (t + ((consp dim) (setq a (instantiate array)) (let* ((i 0) (rank (length dim)) @@ -120,7 +120,8 @@ (setf (array-displaced-index-offset a) displaced-index-offset) (do ((i 0 (1+ i))) ((>= i rank)) - (setslot a array (+ i 5) (elt dim i)))))) + (setslot a array (+ i 5) (elt dim i))))) + (t (error "integer or list expected"))) (when initial-element (fill entity initial-element)) (when initial-contents (fill-initial-contents entity 0 dim initial-contents))