]> git.eshelyaron.com Git - emacs.git/commitdiff
* lisp.h (ASET): Remove attempt to detect side effects.
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Aug 2012 05:21:04 +0000 (22:21 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 26 Aug 2012 05:21:04 +0000 (22:21 -0700)
It was meant to be temporary and it often doesn't work,
because when IDX has side effects the behavior of IDX==IDX
is undefined.  See Stefan Monnier in
<http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.

src/ChangeLog
src/lisp.h

index 54fff9356f3226b82b92c049c367577a2a4f442b..06682f4637e34f98e03bc26ea6824238d5554814 100644 (file)
@@ -1,3 +1,11 @@
+2012-08-26  Paul Eggert  <eggert@cs.ucla.edu>
+
+       * lisp.h (ASET): Remove attempt to detect side effects.
+       It was meant to be temporary and it often doesn't work,
+       because when IDX has side effects the behavior of IDX==IDX
+       is undefined.  See Stefan Monnier in
+       <http://lists.gnu.org/archive/html/emacs-devel/2012-08/msg00762.html>.
+
 2012-08-26  Barry OReilly  <gundaetiapo@gmail.com>  (tiny change)
 
        * lisp.h (functionp): New function (extracted from Ffunctionp).
index c44ba7be3470475425c8cfabb10d6ff9b7677c48..4437fa44b6d5605fdc6e15fc26073582ae4b3ac0 100644 (file)
@@ -606,10 +606,8 @@ clip_to_bounds (ptrdiff_t lower, EMACS_INT num, ptrdiff_t upper)
 
 #define AREF(ARRAY, IDX)       XVECTOR ((ARRAY))->contents[IDX]
 #define ASIZE(ARRAY)           XVECTOR ((ARRAY))->header.size
-/* The IDX==IDX tries to detect when the macro argument is side-effecting.  */
 #define ASET(ARRAY, IDX, VAL)  \
-  (eassert ((IDX) == (IDX)),                           \
-   eassert ((IDX) >= 0 && (IDX) < ASIZE (ARRAY)),      \
+  (eassert (0 <= (IDX) && (IDX) < ASIZE (ARRAY)),      \
    XVECTOR (ARRAY)->contents[IDX] = (VAL))
 
 /* Convenience macros for dealing with Lisp strings.  */