(NSTATICS): Now a constant; doesn't need to be a macro.
+2013-07-19 Paul Eggert <eggert@cs.ucla.edu>
+
+ * alloc.c (staticpro): Avoid buffer overrun on repeated calls.
+ (NSTATICS): Now a constant; doesn't need to be a macro.
+
2013-07-19 Richard Stallman <rms@gnu.org>
* coding.c (decode_coding_utf_8): Add simple loop for fast
/* Addresses of staticpro'd variables. Initialize it to a nonzero
value; otherwise some compilers put it into BSS. */
-#define NSTATICS 0x800
+enum { NSTATICS = 2048 };
static Lisp_Object *staticvec[NSTATICS] = {&Vpurify_flag};
/* Index of next unused slot in staticvec. */
void
staticpro (Lisp_Object *varaddress)
{
- staticvec[staticidx++] = varaddress;
if (staticidx >= NSTATICS)
fatal ("NSTATICS too small; try increasing and recompiling Emacs.");
+ staticvec[staticidx++] = varaddress;
}
\f