X-Git-Url: http://repo.macrolet.net/gitweb/?a=blobdiff_plain;f=src%2Fcompiler%2Ftypetran.lisp;h=c538f46c30ae63f1601b01684096fcbac951b310;hb=f9336e9b3711794feba99b88faadc82ef8cac7f3;hp=06f0de1b1fdbb4bd7c39785c640811a0c38f9783;hpb=2d3cb6dba6461e98744eca2a1df4f770cea468ca;p=sbcl.git diff --git a/src/compiler/typetran.lisp b/src/compiler/typetran.lisp index 06f0de1..c538f46 100644 --- a/src/compiler/typetran.lisp +++ b/src/compiler/typetran.lisp @@ -554,7 +554,12 @@ ((csubtypep tspec (specifier-type 'float)) '(%single-float x)) ((and (csubtypep tspec (specifier-type 'simple-vector)) - (policy node (< safety 3))) + ;; Can we avoid checking for dimension issues like + ;; (COERCE FOO '(SIMPLE-VECTOR 5)) returning a + ;; vector of length 6? + (or (policy node (< safety 3)) ; no need in unsafe code + (and (array-type-p tspec) ; no need when no dimensions + (equal (array-type-dimensions tspec) '(*))))) `(if (simple-vector-p x) x (replace (make-array (length x)) x))) @@ -562,3 +567,4 @@ (t (give-up-ir1-transform))))))) +