1.0.47.19: another MAKE-INSTANCE regression from 1.0.45.18
authorNikodemus Siivola <nikodemus@random-state.net>
Sun, 10 Apr 2011 09:21:46 +0000 (09:21 +0000)
committerNikodemus Siivola <nikodemus@random-state.net>
Sun, 10 Apr 2011 09:21:46 +0000 (09:21 +0000)
  ...which was masked by another regression till 1.0.46.15.

  Inverted conditional: (SLOT-BOUNDP-USING-CLASS ...) where it should
  have been (NOT (SLOT-BOUNDP-USING-CLASS ...)).

  Reported by Pascal Costanza on sbcl-devel.

NEWS
src/pcl/ctor.lisp
tests/compiler.pure.lisp
tests/mop.impure.lisp
version.lisp-expr

diff --git a/NEWS b/NEWS
index 7ccf2ef..26baf55 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -16,6 +16,8 @@ changes relative to sbcl-1.0.47:
   * bug fix: forms such as (FUNCALL (FUNCTION NAME OOPS) ...) were compiled
     without complaints.
   * bug fix: less verbose source forms for functions from EVAL. (lp#747485)
+  * bug fix: sense of SLOT-BOUNDP-USING-CLASS was inverted in a MAKE-INSTANCE
+    optimization. (regression from 1.0.45.18/1.0.46.15)
 
 changes in sbcl-1.0.47 relative to sbcl-1.0.46:
   * bug fix: fix mach port rights leaks in mach exception handling code on
index 4237d1c..f73b658 100644 (file)
                                             ,value-form))))
                              (not-boundp-form ()
                                (if (member slotd sbuc-slots :test #'eq)
-                                   `(slot-boundp-using-class
-                                     ,class .instance. ,slotd)
+                                   `(not (slot-boundp-using-class
+                                          ,class .instance. ,slotd))
                                    `(eq (clos-slots-ref .slots. ,i)
                                         +slot-unbound+))))
                         (ecase kind
index 51068be..41b122e 100644 (file)
   ;; Test that compile-times don't explode when quoted constants
   ;; get big.
   (labels ((time-n (n)
-             (gc :full t) ; Let's not confuse the issue with GC            
+             (gc :full t) ; Let's not confuse the issue with GC
              (let* ((tree (make-tree (expt 10 n) nil))
                     (t0 (get-internal-run-time))
                     (f (compile nil `(lambda (x) (eq x (quote ,tree)))))
index 35118d0..0f3b115 100644 (file)
 (with-test (:name :slow-method-is-fboundp)
   (assert (fboundp '(sb-pcl::slow-method wrapped (cons))))
   (assert (eq :default (funcall #'(sb-pcl::slow-method wrapped (cons)) (list (cons t t)) nil))))
+
+;;; Check that SLOT-BOUNDP-USING-CLASS doesn't confuse MAKE-INSTANCE
+;;; optimizations.
+(defclass sbuc-mio-test-class (standard-class)
+  ())
+(defmethod validate-superclass ((class sbuc-mio-test-class)
+                                (superclass standard-class))
+  t)
+(defvar *sbuc-counter* 0)
+(defmethod slot-boundp-using-class ((class sbuc-mio-test-class)
+                                    (object t)
+                                    (slot standard-effective-slot-definition))
+  (incf *sbuc-counter*)
+  (call-next-method))
+(defclass sbuc-mio-test-object ()
+  ((slot :initform 5 :accessor a-slot))
+  (:metaclass sbuc-mio-test-class))
+(with-test (:name :sbuc-mio-test)
+  (assert (= 5 (funcall
+                (compile
+                 nil
+                 `(lambda ()
+                    (let ((object (make-instance 'sbuc-mio-test-object)))
+                      (slot-value object 'slot)))))))
+  (assert (= 1 *sbuc-counter*)))
 \f
 ;;;; success
index a2ad1f8..3d95583 100644 (file)
@@ -20,4 +20,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.47.18"
+"1.0.47.19"