Commit 3884d954 authored by Dmitry Antipov's avatar Dmitry Antipov
Browse files

* buffer.c (init_buffer_once): Fix initialization of

headers for buffer_defaults and buffer_local_symbols.
Reported by Juanma Barranquero <lekktu@gmail.com>.
parent b5771c0d
2012-07-04 Dmitry Antipov <dmantipov@yandex.ru>
* buffer.c (init_buffer_once): Fix initialization of
headers for buffer_defaults and buffer_local_symbols.
Reported by Juanma Barranquero <lekktu@gmail.com>.
2012-07-04 Stefan Monnier <monnier@iro.umontreal.ca>
Turn VECTOR_FREE_LIST_FLAG into PVEC_FREE.
......
......@@ -4870,6 +4870,12 @@ void
init_buffer_once (void)
{
int idx;
/* If you add, remove, or reorder Lisp_Objects in a struct buffer, make
sure that this is still correct. Otherwise, mark_vectorlike may not
trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */
const int pvecsize
= (offsetof (struct buffer, own_text) - sizeof (struct vectorlike_header))
/ sizeof (Lisp_Object);
memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags);
......@@ -4886,9 +4892,9 @@ init_buffer_once (void)
buffer_local_symbols.text = &buffer_local_symbols.own_text;
BUF_INTERVALS (&buffer_defaults) = 0;
BUF_INTERVALS (&buffer_local_symbols) = 0;
XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, 0);
XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize);
XSETBUFFER (Vbuffer_defaults, &buffer_defaults);
XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, 0);
XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize);
XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols);
/* Set up the default values of various buffer slots. */
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment