diff options
| author | Barry O'Reilly | 2013-09-25 23:46:47 -0400 |
|---|---|---|
| committer | Barry O'Reilly | 2013-09-25 23:46:47 -0400 |
| commit | ba355de014b75ed104da4777f909db70d62f2357 (patch) | |
| tree | dab161a69cb4e4dc54e07ac1d465bf39c8aad475 /src/alloc.c | |
| parent | 3958758036f64a1c93728ab0a2cb9ea872c59e35 (diff) | |
| download | emacs-ba355de014b75ed104da4777f909db70d62f2357.tar.gz emacs-ba355de014b75ed104da4777f909db70d62f2357.zip | |
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.c | 4 |
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) | |||
| 2889 | free_this_block = 1; | 2889 | free_this_block = 1; |
| 2890 | else | 2890 | else |
| 2891 | { | 2891 | { |
| 2892 | int tmp; | 2892 | size_t tmp; |
| 2893 | SETUP_ON_FREE_LIST (vector, total_bytes, tmp); | 2893 | SETUP_ON_FREE_LIST (vector, total_bytes, tmp); |
| 2894 | } | 2894 | } |
| 2895 | } | 2895 | } |
| @@ -3132,6 +3132,8 @@ usage: (vector &rest OBJECTS) */) | |||
| 3132 | void | 3132 | void |
| 3133 | make_byte_code (struct Lisp_Vector *v) | 3133 | make_byte_code (struct Lisp_Vector *v) |
| 3134 | { | 3134 | { |
| 3135 | /* Don't allow the global zero_vector to become a byte code object. */ | ||
| 3136 | eassert(0 < v->header.size); | ||
| 3135 | if (v->header.size > 1 && STRINGP (v->u.contents[1]) | 3137 | if (v->header.size > 1 && STRINGP (v->u.contents[1]) |
| 3136 | && STRING_MULTIBYTE (v->u.contents[1])) | 3138 | && STRING_MULTIBYTE (v->u.contents[1])) |
| 3137 | /* BYTECODE-STRING must have been produced by Emacs 20.2 or the | 3139 | /* BYTECODE-STRING must have been produced by Emacs 20.2 or the |