GNU bug report logs -
#36649
27.0.50; pure space and pdumper
Previous Next
Reported by: Pip Cet <pipcet <at> gmail.com>
Date: Sun, 14 Jul 2019 14:27:01 UTC
Severity: wishlist
Tags: patch
Found in version 27.0.50
Done: Pip Cet <pipcet <at> protonmail.com>
Bug is archived. No further changes may be made.
Full log
Message #41 received at 36649 <at> debbugs.gnu.org (full text, mbox):
>>>>> On Sun, 21 Jul 2019 19:35:01 +0000, Pip Cet <pipcet <at> gmail.com> said:
Pip> Thanks! I messed up quite badly initializing the zero vector, it turns
Pip> out, so it was trying to initialize the first entry in the zero
Pip> vector, which, er, obviously wasn't a good idea :-)
Pip> Can you try again with this incremental patch?
I offer two alternatives, both of which build and run:
diff --git i/src/alloc.c w/src/alloc.c
index 1b55ad8cab..206f0ce8d7 100644
--- i/src/alloc.c
+++ w/src/alloc.c
@@ -3091,7 +3091,7 @@ #define VECTOR_ELTS_MAX \
static struct Lisp_Vector *
allocate_vectorlike (ptrdiff_t len)
{
- eassert (0 < len && len <= VECTOR_ELTS_MAX);
+ eassert (0 <= len && len <= VECTOR_ELTS_MAX);
ptrdiff_t nbytes = header_size + len * word_size;
struct Lisp_Vector *p;
@@ -3151,8 +3151,8 @@ allocate_vector (ptrdiff_t len)
init_vectors (void)
{
zero_vector =
- make_lisp_ptr (allocate_vectorlike (sizeof (struct Lisp_Vector)),
- Lisp_Vectorlike);
+ make_lisp_ptr (allocate_vectorlike (0), Lisp_Vectorlike);
+ XVECTOR(zero_vector)->header.size = 0;
staticpro (&zero_vector);
}
diff --git i/src/alloc.c w/src/alloc.c
index 1b55ad8cab..294aa9a2aa 100644
--- i/src/alloc.c
+++ w/src/alloc.c
@@ -3151,8 +3151,8 @@ allocate_vector (ptrdiff_t len)
init_vectors (void)
{
zero_vector =
- make_lisp_ptr (allocate_vectorlike (sizeof (struct Lisp_Vector)),
- Lisp_Vectorlike);
+ make_lisp_ptr (allocate_vectorlike (1), Lisp_Vectorlike);
+ XVECTOR(zero_vector)->header.size = 0;
staticpro (&zero_vector);
}
This bug report was last modified 199 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.