0.8.17.30:
authorAlexey Dejneka <adejneka@comail.ru>
Sun, 19 Dec 2004 09:59:18 +0000 (09:59 +0000)
committerAlexey Dejneka <adejneka@comail.ru>
Sun, 19 Dec 2004 09:59:18 +0000 (09:59 +0000)
        * Merged patch for the bug 348 by Gabor Melis.

BUGS
NEWS
src/code/defstruct.lisp
tests/defstruct.impure.lisp
version.lisp-expr

diff --git a/BUGS b/BUGS
index 95bad80..010c3b7 100644 (file)
--- a/BUGS
+++ b/BUGS
@@ -1538,19 +1538,6 @@ WORKAROUND:
   In sbcl-0.8.13, all backtraces from errors caused by internal errors
   on the alpha seem to have a "bogus stack frame".
 
-348:
-  Structure slot setters do not preserve evaluation order:
-
-    (defstruct foo (x))
-
-    (let ((i (eval '-2))
-          (x (make-foo)))
-      (funcall #'(setf foo-x)
-               (incf i)
-               (aref (vector x) (incf i)))
-      (foo-x x))
-    => error
-
 349: PPRINT-INDENT rounding implementation decisions
   At present, pprint-indent (and indeed the whole pretty printer)
   more-or-less assumes that it's using a monospace font.  That's
diff --git a/NEWS b/NEWS
index 4e93d5a..d956277 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -31,6 +31,8 @@ changes in sbcl-0.8.18 relative to sbcl-0.8.17:
     argument, which must always be NIL. (reported by Kalle Niemitalo)
   * bug fix: printing 1.0d+23 no longer results in an error.
     (reported by Rolf Wester for CMUCL; bug fix from Raymond Toy)
+  * bug fix: structure slot setters preserve evaluation order. (thanks
+    to Gabor Melis)
   * fixed some bugs related to Unicode integration:
     ** RUN-PROGRAM can allow its child to take input from a Lisp
        stream.  (reported by Stefan Scholl)
index 182e978..8a72c68 100644 (file)
               `(,value-the ,dsd-type ,(subst instance 'instance
                                              accessor-place-form)))
             (sb!c:source-transform-lambda (new-value instance)
-               (destructuring-bind (accessor-name &rest accessor-args)
-                   accessor-place-form
-                 `(,(info :setf :inverse accessor-name)
-                    ,@(subst instance 'instance accessor-args)
-                    (the ,dsd-type ,new-value)))))))
+              (destructuring-bind (accessor-name &rest accessor-args)
+                  accessor-place-form
+                (once-only ((new-value new-value)
+                            (instance instance))
+                  `(,(info :setf :inverse accessor-name)
+                     ,@(subst instance 'instance accessor-args)
+                     (the ,dsd-type ,new-value))))))))
 
 ;;; Return a LAMBDA form which can be used to set a slot.
 (defun slot-setter-lambda-form (dd dsd)
index 5f9aa1d..f1b06b5 100644 (file)
             (setf (find-class 'foo) nil)
             (defstruct foo slot-1)))))
 
+;;; bug 348, evaluation order of slot writer arguments. Fixed by Gabor
+;;; Melis.
+(defstruct bug-348 x)
+
+(assert (eql -1 (let ((i (eval '-2))
+                      (x (make-bug-348)))
+                  (funcall #'(setf bug-348-x)
+                           (incf i)
+                           (aref (vector x) (incf i)))
+                  (bug-348-x x))))
+
 ;;; success
 (format t "~&/returning success~%")
 (quit :unix-status 104)
index a880985..bb83dce 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".)
-"0.8.17.29"
+"0.8.17.30"