1.0.43.82: Make compiling a MAKE-ARRAY call with a bad keyword list signal warning
authorJuho Snellman <jsnell@iki.fi>
Sat, 30 Oct 2010 13:30:12 +0000 (13:30 +0000)
committerJuho Snellman <jsnell@iki.fi>
Sat, 30 Oct 2010 13:30:12 +0000 (13:30 +0000)
     * Instead of a crashing inside the guts of the compiler...
     * lp#664373, patch by Stas Boukarev

NEWS
src/compiler/array-tran.lisp
tests/array.pure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 4c6b558..a112344 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -89,6 +89,8 @@ changes relative to sbcl-1.0.43:
     core was reified. 
   * bug fix: Allow UNTRACE of functions that are no longer defined
     (lp#667657, thanks to Attila Lendvai)
+  * bug fix: MAKE-ARRAY calls with invalid keyword argument lists now signal a
+    compile-time warning (lp#664373, thanks to Stas Boukarev)
 
 changes in sbcl-1.0.43 relative to sbcl-1.0.42:
   * incompatible change: FD-STREAMS no longer participate in the serve-event
index 75b11b9..82b3bdb 100644 (file)
 ;;; can pick them apart in the DEFTRANSFORMS, and transform '(3) style
 ;;; dimensions to integer args directly.
 (define-source-transform make-array (dimensions &rest keyargs &environment env)
-  (if (and (fun-lexically-notinline-p 'list)
-           (fun-lexically-notinline-p 'vector))
+  (if (or (and (fun-lexically-notinline-p 'list)
+               (fun-lexically-notinline-p 'vector))
+          (oddp (length keyargs)))
       (values nil t)
       (multiple-value-bind (new-dimensions rank)
           (flet ((constant-dims (dimensions)
index 4c605ed..901beba 100644 (file)
                              (eql 6 (type-error-datum e)))
                     :good))))))
 
+(with-test (:name :odd-keys-for-make-array)
+  (assert (eq :good
+              (handler-case
+                  (compile nil '(lambda (m) (make-array m 1)))
+                (simple-warning () :good)))))
+
index 8edf8dd..140964b 100644 (file)
@@ -17,4 +17,4 @@
 ;;; checkins which aren't released. (And occasionally for internal
 ;;; versions, especially for internal versions off the main CVS
 ;;; branch, it gets hairier, e.g. "0.pre7.14.flaky4.13".)
-"1.0.43.81"
+"1.0.43.82"