diff options
| author | Dmitry Antipov | 2012-07-04 19:49:46 +0400 |
|---|---|---|
| committer | Dmitry Antipov | 2012-07-04 19:49:46 +0400 |
| commit | 3884d954f32acb816332d7837fe813bc546f6268 (patch) | |
| tree | 9d2b944ab9774d64db5251dab0b4b58632233680 /src/buffer.c | |
| parent | b5771c0d82b0c1b376e53d8bb92ec4137901db67 (diff) | |
| download | emacs-3884d954f32acb816332d7837fe813bc546f6268.tar.gz emacs-3884d954f32acb816332d7837fe813bc546f6268.zip | |
* buffer.c (init_buffer_once): Fix initialization of
headers for buffer_defaults and buffer_local_symbols.
Reported by Juanma Barranquero <lekktu@gmail.com>.
Diffstat (limited to 'src/buffer.c')
| -rw-r--r-- | src/buffer.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/src/buffer.c b/src/buffer.c index 1e68d7d6b74..e1652e9e105 100644 --- a/src/buffer.c +++ b/src/buffer.c | |||
| @@ -4870,6 +4870,12 @@ void | |||
| 4870 | init_buffer_once (void) | 4870 | init_buffer_once (void) |
| 4871 | { | 4871 | { |
| 4872 | int idx; | 4872 | int idx; |
| 4873 | /* If you add, remove, or reorder Lisp_Objects in a struct buffer, make | ||
| 4874 | sure that this is still correct. Otherwise, mark_vectorlike may not | ||
| 4875 | trace all Lisp_Objects in buffer_defaults and buffer_local_symbols. */ | ||
| 4876 | const int pvecsize | ||
| 4877 | = (offsetof (struct buffer, own_text) - sizeof (struct vectorlike_header)) | ||
| 4878 | / sizeof (Lisp_Object); | ||
| 4873 | 4879 | ||
| 4874 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); | 4880 | memset (buffer_permanent_local_flags, 0, sizeof buffer_permanent_local_flags); |
| 4875 | 4881 | ||
| @@ -4886,9 +4892,9 @@ init_buffer_once (void) | |||
| 4886 | buffer_local_symbols.text = &buffer_local_symbols.own_text; | 4892 | buffer_local_symbols.text = &buffer_local_symbols.own_text; |
| 4887 | BUF_INTERVALS (&buffer_defaults) = 0; | 4893 | BUF_INTERVALS (&buffer_defaults) = 0; |
| 4888 | BUF_INTERVALS (&buffer_local_symbols) = 0; | 4894 | BUF_INTERVALS (&buffer_local_symbols) = 0; |
| 4889 | XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, 0); | 4895 | XSETPVECTYPESIZE (&buffer_defaults, PVEC_BUFFER, pvecsize); |
| 4890 | XSETBUFFER (Vbuffer_defaults, &buffer_defaults); | 4896 | XSETBUFFER (Vbuffer_defaults, &buffer_defaults); |
| 4891 | XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, 0); | 4897 | XSETPVECTYPESIZE (&buffer_local_symbols, PVEC_BUFFER, pvecsize); |
| 4892 | XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols); | 4898 | XSETBUFFER (Vbuffer_local_symbols, &buffer_local_symbols); |
| 4893 | 4899 | ||
| 4894 | /* Set up the default values of various buffer slots. */ | 4900 | /* Set up the default values of various buffer slots. */ |