+2013-09-26 Barry O'Reilly <gundaetiapo@gmail.com>
+
+ Signal error when reading an empty byte-code object (Bug#15405)
+ * lread.c (read1): signal error
+ * alloc.c (make_byte_code): eassert header size
+ (sweep_vectors): change an int to size_t
+
2013-09-24 Paul Eggert <eggert@cs.ucla.edu>
* dispnew.c (clear_glyph_row, copy_row_except_pointers): Use enums
free_this_block = 1;
else
{
- int tmp;
+ size_t tmp;
SETUP_ON_FREE_LIST (vector, total_bytes, tmp);
}
}
void
make_byte_code (struct Lisp_Vector *v)
{
+ /* Don't allow the global zero_vector to become a byte code object. */
+ eassert(0 < v->header.size);
if (v->header.size > 1 && STRINGP (v->u.contents[1])
&& STRING_MULTIBYTE (v->u.contents[1]))
/* BYTECODE-STRING must have been produced by Emacs 20.2 or the
build them using function calls. */
Lisp_Object tmp;
tmp = read_vector (readcharfun, 1);
- make_byte_code (XVECTOR (tmp));
+ struct Lisp_Vector* vec = XVECTOR (tmp);
+ if (vec->header.size==0)
+ invalid_syntax ("Empty byte-code object");
+ make_byte_code (vec);
return tmp;
}
if (c == '(')