From: Nikodemus Siivola Date: Tue, 9 Jun 2009 12:23:51 +0000 (+0000) Subject: 1.0.29.5: list item seek transform needs to check for both :TEST and :TEST-NOT X-Git-Url: http://repo.macrolet.net/gitweb/?a=commitdiff_plain;h=13fb19c3183a0effb7c35a2d453d6c6c91726e26;p=sbcl.git 1.0.29.5: list item seek transform needs to check for both :TEST and :TEST-NOT * When both are provided, abort the transform and let the full call take care of signalling the error. Reported by Tobias Ritterweiler. --- diff --git a/NEWS b/NEWS index f90c720..bfb9975 100644 --- 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 diff --git a/src/compiler/seqtran.lisp b/src/compiler/seqtran.lisp index 8f83892..4ff8a4d 100644 --- a/src/compiler/seqtran.lisp +++ b/src/compiler/seqtran.lisp @@ -317,6 +317,8 @@ 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)) diff --git a/tests/seq.impure.lisp b/tests/seq.impure.lisp index ddc416d..ffb1ec7 100644 --- a/tests/seq.impure.lisp +++ b/tests/seq.impure.lisp @@ -13,10 +13,11 @@ ;;;; 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) @@ -1100,5 +1101,21 @@ (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)))))) ;;; success diff --git a/version.lisp-expr b/version.lisp-expr index 326fa46..7b27937 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.29.4" +"1.0.29.5"