0.8.1.6:
[sbcl.git] / src / compiler / array-tran.lisp
index 3bce548..d0f9baf 100644 (file)
                    (t
                     '*))
             ,(cond ((constant-continuation-p dims)
-                    (let ((val (continuation-value dims)))
-                      (if (listp val) val (list val))))
+                    (let* ((val (continuation-value dims))
+                          (cdims (if (listp val) val (list val))))
+                     (if simple
+                         cdims
+                         (length cdims))))
                    ((csubtypep (continuation-type dims)
                                (specifier-type 'integer))
                     '(*))
 ;;; Primitive used to verify indices into arrays. If we can tell at
 ;;; compile-time or we are generating unsafe code, don't bother with
 ;;; the VOP.
-(deftransform %check-bound ((array dimension index))
-  (unless (constant-continuation-p dimension)
-    (give-up-ir1-transform))
-  (let ((dim (continuation-value dimension)))
-    `(the (integer 0 ,dim) index)))
-(deftransform %check-bound ((array dimension index) * *
-                           :policy (and (> speed safety) (= safety 0)))
-  'index)
+(deftransform %check-bound ((array dimension index) * * :node node)
+  (cond ((policy node (and (> speed safety) (= safety 0)))
+         'index)
+        ((not (constant-continuation-p dimension))
+         (give-up-ir1-transform))
+        (t
+         (let ((dim (continuation-value dimension)))
+           `(the (integer 0 (,dim)) index)))))
 \f
 ;;;; WITH-ARRAY-DATA