1.0.29.5: list item seek transform needs to check for both :TEST and :TEST-NOT
authorNikodemus Siivola <nikodemus@random-state.net>
Tue, 9 Jun 2009 12:23:51 +0000 (12:23 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Tue, 9 Jun 2009 12:23:51 +0000 (12:23 +0000)
* When both are provided, abort the transform and let the full call
  take care of signalling the error. Reported by Tobias Ritterweiler.

NEWS
src/compiler/seqtran.lisp
tests/seq.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index f90c720..bfb9975 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -7,6 +7,9 @@
   * bug fix: on 64 bit platforms FILL worked incorrectly on arrays with
     upgraded element type (COMPLEX SINGLE-FLOAT), regression from 1.0.28.55.
     (thanks to Paul Khuong)
+  * bug fix: better error signalling when calls to functions seeking elements
+    from lists (eg. ADJOIN) are compiled with both :TEST and :TEST-NOT.
+    (reported by Tobias Rittweiler)
 
 changes in sbcl-1.0.29 relative to 1.0.28:
   * IMPORTANT: bug database has moved from the BUGS file to Launchpad
index 8f83892..4ff8a4d 100644 (file)
            function-name key-functions variant)))
 
 (defun transform-list-item-seek (name item list key test test-not node)
+  (when (and test test-not)
+    (abort-ir1-transform "Both ~S and ~S supplied to ~S." :test :test-not name))
   ;; If TEST is EQL, drop it.
   (when (and test (lvar-fun-is test '(eql)))
     (setf test nil))
index ddc416d..ffb1ec7 100644 (file)
 ;;;; absolutely no warranty. See the COPYING and CREDITS files for
 ;;;; more information.
 
+(load "test-util.lisp")
 (load "assertoid.lisp")
 
 (defpackage :seq-test
-  (:use :cl :assertoid))
+  (:use :cl :assertoid :test-util))
 
 (in-package :seq-test)
 
   (assert (raises-error? (fill l 0 :start 4)))
   (assert (raises-error? (fill l 0 :end 4)))
   (assert (raises-error? (fill l 0 :start 2 :end 1))))
+
+;;; Both :TEST and :TEST-NOT provided
+(with-test (:name :test-and-test-not-to-adjoin)
+  (let* ((wc 0)
+         (fun
+          (handler-bind (((and warning (not style-warning))
+                          (lambda (w) (incf wc))))
+            (compile nil `(lambda (item test test-not) (adjoin item '(1 2 3 :foo)
+                                                               :test test
+                                                               :test-not test-not))))))
+    (assert (= 1 wc))
+    (assert (eq :error
+                (handler-case
+                    (funcall fun 1 #'eql (complement #'eql))
+                  (error ()
+                    :error))))))
 \f
 ;;; success
index 326fa46..7b27937 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.29.4"
+"1.0.29.5"