mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-01-08 04:30:45 -08:00
Fix GC bugs related to uninitialized vectors
Avoid problems if GC occurs while initializing a vector. Problem with Fdelete reported by Pip Cet in: https://lists.gnu.org/r/emacs-devel/2020-08/msg00313.html I looked for similar problems elsewhere and found quite a few. * src/coding.c (make_subsidiaries): * src/composite.c (syms_of_composite): * src/font.c (build_style_table, Ffont_get_glyphs): * src/nsselect.m (clean_local_selection_data): * src/nsxwidget.m (js_to_lisp): * src/syntax.c (init_syntax_once): * src/window.c (Fcurrent_window_configuration): * src/xselect.c (selection_data_to_lisp_data) (clean_local_selection_data): Use make_nil_vector instead of make_uninit_vector. * src/fns.c (Fdelete): * src/xwidget.c (webkit_js_to_lisp): Use allocate_nil_vector instead of allocate_vector. * src/search.c (Fnewline_cache_check): Use make_vector instead of make_uninit_vector.
This commit is contained in:
parent
4cba236749
commit
d0145537fa
12 changed files with 26 additions and 31 deletions
|
|
@ -10856,20 +10856,17 @@ HIGHESTP non-nil means just return the highest priority one. */)
|
|||
return Fnreverse (val);
|
||||
}
|
||||
|
||||
static const char *const suffixes[] = { "-unix", "-dos", "-mac" };
|
||||
|
||||
static Lisp_Object
|
||||
make_subsidiaries (Lisp_Object base)
|
||||
{
|
||||
Lisp_Object subsidiaries;
|
||||
static char const suffixes[][8] = { "-unix", "-dos", "-mac" };
|
||||
ptrdiff_t base_name_len = SBYTES (SYMBOL_NAME (base));
|
||||
USE_SAFE_ALLOCA;
|
||||
char *buf = SAFE_ALLOCA (base_name_len + 6);
|
||||
int i;
|
||||
|
||||
memcpy (buf, SDATA (SYMBOL_NAME (base)), base_name_len);
|
||||
subsidiaries = make_uninit_vector (3);
|
||||
for (i = 0; i < 3; i++)
|
||||
Lisp_Object subsidiaries = make_nil_vector (3);
|
||||
for (int i = 0; i < 3; i++)
|
||||
{
|
||||
strcpy (buf + base_name_len, suffixes[i]);
|
||||
ASET (subsidiaries, i, intern (buf));
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue