From: Paul Eggert Date: Sun, 26 Aug 2012 05:21:04 +0000 (-0700) Subject: * lisp.h (ASET): Remove attempt to detect side effects. X-Git-Tag: emacs-24.2.90~510 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6af64513413d7194cfa2d8308db2d73f6ed64bf4;p=emacs.git * 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 . --- diff --git a/src/ChangeLog b/src/ChangeLog index 54fff9356f3..06682f4637e 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-08-26 Paul Eggert + + * 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 + . + 2012-08-26 Barry OReilly (tiny change) * lisp.h (functionp): New function (extracted from Ffunctionp). diff --git a/src/lisp.h b/src/lisp.h index c44ba7be347..4437fa44b6d 100644 --- a/src/lisp.h +++ b/src/lisp.h @@ -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. */