summaryrefslogtreecommitdiff
path: root/src/alloc.c
diff options
context:
space:
mode:
authorBarry O'Reilly <gundaetiapo@gmail.com>2013-09-25 23:46:47 -0400
committerBarry O'Reilly <gundaetiapo@gmail.com>2013-09-25 23:46:47 -0400
commitba355de014b75ed104da4777f909db70d62f2357 (patch)
treedab161a69cb4e4dc54e07ac1d465bf39c8aad475 /src/alloc.c
parent3958758036f64a1c93728ab0a2cb9ea872c59e35 (diff)
downloademacs-ba355de014b75ed104da4777f909db70d62f2357.tar.gz
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
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/alloc.c b/src/alloc.c
index ca21ba2469b..2d9828ffa79 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2889,7 +2889,7 @@ sweep_vectors (void)
free_this_block = 1;
else
{
- int tmp;
+ size_t tmp;
SETUP_ON_FREE_LIST (vector, total_bytes, tmp);
}
}
@@ -3132,6 +3132,8 @@ usage: (vector &rest OBJECTS) */)
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