aboutsummaryrefslogtreecommitdiffstats
path: root/src/alloc.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/alloc.c')
-rw-r--r--src/alloc.c9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/alloc.c b/src/alloc.c
index 7c560fd0f0d..283bc613c82 100644
--- a/src/alloc.c
+++ b/src/alloc.c
@@ -2066,8 +2066,7 @@ Lisp_Object
2066make_uninit_bool_vector (EMACS_INT nbits) 2066make_uninit_bool_vector (EMACS_INT nbits)
2067{ 2067{
2068 Lisp_Object val; 2068 Lisp_Object val;
2069 EMACS_INT words0 = bool_vector_words (nbits); 2069 EMACS_INT words = bool_vector_words (nbits);
2070 EMACS_INT words = words0 + !words0; /* Allocate at least one word. */
2071 EMACS_INT word_bytes = words * sizeof (bits_word); 2070 EMACS_INT word_bytes = words * sizeof (bits_word);
2072 EMACS_INT needed_elements = ((bool_header_size - header_size + word_bytes 2071 EMACS_INT needed_elements = ((bool_header_size - header_size + word_bytes
2073 + word_size - 1) 2072 + word_size - 1)
@@ -2078,9 +2077,9 @@ make_uninit_bool_vector (EMACS_INT nbits)
2078 XSETPVECTYPESIZE (XVECTOR (val), PVEC_BOOL_VECTOR, 0, 0); 2077 XSETPVECTYPESIZE (XVECTOR (val), PVEC_BOOL_VECTOR, 0, 0);
2079 p->size = nbits; 2078 p->size = nbits;
2080 2079
2081 /* Clear padding at the end. If NBITS != 0 this initializes more 2080 /* Clear padding at the end. */
2082 than it needs to, but that's OK. */ 2081 if (words)
2083 p->data[words - 1] = 0; 2082 p->data[words - 1] = 0;
2084 2083
2085 return val; 2084 return val;
2086} 2085}