Commit 4b75ffab authored by Stefan Monnier's avatar Stefan Monnier

(ASET): Check bounds.

parent 250962b3
2008-02-10 Stefan Monnier <monnier@iro.umontreal.ca>
* lisp.h (ASET): Check bounds.
2008-02-10 Glenn Morris <rgm@gnu.org>
* buffer.c (mode-name): Doc fix.
......
......@@ -589,8 +589,12 @@ extern size_t pure_size;
/* 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. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment