]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp/subr.el (pop): Don't call the getter twice.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 6 Nov 2014 03:27:23 +0000 (22:27 -0500)
committerStefan Monnier <monnier@iro.umontreal.ca>
Thu, 6 Nov 2014 03:27:23 +0000 (22:27 -0500)
Fixes: debbugs:18968
lisp/ChangeLog
lisp/subr.el

index 91a076e20e5ec32da615760aa8538f3a8cd39783..7dc4786aff5178f5a5773f853d4d73f31c680345 100644 (file)
@@ -1,5 +1,7 @@
 2014-11-06  Stefan Monnier  <monnier@iro.umontreal.ca>
 
+       * subr.el (pop): Don't call the getter twice (bug#18968).
+
        * emacs-lisp/macroexp.el (macroexp--expand-all): Optimize away trivial
        uses of `funcall'.
 
index 55ff739fec5b52119b937a460a697040b3ef5276..6ce02b79a0a88d6f6389961b14ece5b4ac5bab78 100644 (file)
@@ -169,7 +169,8 @@ change the list."
          ;; So we can use `pop' in the bootstrap before `gv' can be used.
          (list 'prog1 place (list 'setq place (list 'cdr place)))
        (gv-letplace (getter setter) place
-         `(prog1 ,getter ,(funcall setter `(cdr ,getter)))))))
+         (macroexp-let2 macroexp-copyable-p x getter
+           `(prog1 ,x ,(funcall setter `(cdr ,x))))))))
 
 (defmacro when (cond &rest body)
   "If COND yields non-nil, do BODY, else return nil.