X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Farray-tran.lisp;h=3403ac30c9c396f8a807a4a94c3b2675124c03d2;hb=792668aff416a047bb3df218d448d8660303d1db;hp=f3cf13671892cfcdfdade46346322ef55c74f4b6;hpb=3b9d0f932481fbc9cf2eabc5bb160452927682b6;p=sbcl.git diff --git a/src/compiler/array-tran.lisp b/src/compiler/array-tran.lisp index f3cf136..3403ac3 100644 --- a/src/compiler/array-tran.lisp +++ b/src/compiler/array-tran.lisp @@ -722,14 +722,16 @@ (t :maybe))) ;;; If we can tell the rank from the type info, use it instead. -(deftransform array-rank ((array)) +(deftransform array-rank ((array) (array) * :node node) (let ((array-type (lvar-type array))) (let ((dims (array-type-dimensions-or-give-up array-type))) (cond ((listp dims) (length dims)) - ((eq t (array-type-complexp array-type)) + ((eq t (and (array-type-p array-type) + (array-type-complexp array-type))) '(%array-rank array)) (t + (delay-ir1-transform node :constraint) `(if (array-header-p array) (%array-rank array) 1))))))