From a5b1b81acd785b8864ec8ef48c17ac2b48bc1d06 Mon Sep 17 00:00:00 2001 From: Juho Snellman Date: Sat, 30 Oct 2010 13:30:12 +0000 Subject: [PATCH] 1.0.43.82: Make compiling a MAKE-ARRAY call with a bad keyword list signal warning * Instead of a crashing inside the guts of the compiler... * lp#664373, patch by Stas Boukarev --- NEWS | 2 ++ src/compiler/array-tran.lisp | 5 +++-- tests/array.pure.lisp | 6 ++++++ version.lisp-expr | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/NEWS b/NEWS index 4c6b558..a112344 100644 --- 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 diff --git a/src/compiler/array-tran.lisp b/src/compiler/array-tran.lisp index 75b11b9..82b3bdb 100644 --- a/src/compiler/array-tran.lisp +++ b/src/compiler/array-tran.lisp @@ -337,8 +337,9 @@ ;;; 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) diff --git a/tests/array.pure.lisp b/tests/array.pure.lisp index 4c605ed..901beba 100644 --- a/tests/array.pure.lisp +++ b/tests/array.pure.lisp @@ -277,3 +277,9 @@ (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))))) + diff --git a/version.lisp-expr b/version.lisp-expr index 8edf8dd..140964b 100644 --- a/version.lisp-expr +++ b/version.lisp-expr @@ -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" -- 1.7.10.4