emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/src/lisp.h,v


From: Stefan Monnier
Subject: [Emacs-diffs] Changes to emacs/src/lisp.h,v
Date: Sun, 10 Feb 2008 03:20:41 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Stefan Monnier <monnier>        08/02/10 03:20:41

Index: lisp.h
===================================================================
RCS file: /sources/emacs/emacs/src/lisp.h,v
retrieving revision 1.607
retrieving revision 1.608
diff -u -b -r1.607 -r1.608
--- lisp.h      9 Feb 2008 18:03:08 -0000       1.607
+++ lisp.h      10 Feb 2008 03:20:40 -0000      1.608
@@ -589,8 +589,12 @@
 /* Convenience macros for dealing with Lisp arrays.  */
 
 #define AREF(ARRAY, IDX)       XVECTOR ((ARRAY))->contents[IDX]
-#define ASET(ARRAY, IDX, VAL)  (AREF ((ARRAY), (IDX)) = (VAL))
 #define ASIZE(ARRAY)           XVECTOR ((ARRAY))->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)),      \
+   ASLOT ((ARRAY), (IDX)) = (VAL))
 
 /* Convenience macros for dealing with Lisp strings.  */
 




reply via email to

[Prev in Thread] Current Thread [Next in Thread]