mirror of
git://git.sv.gnu.org/emacs.git
synced 2026-06-14 12:31:25 +00:00
Avoid segfaults if someone sets 'composition-function-table' to nil
* src/composite.c (composition_compute_stop_pos) (composition_reseat_it): Recreate 'composition-function-table' if it ever becomes garbled. (Bug#80462)
This commit is contained in:
parent
b055b6e889
commit
f3555fc846
1 changed files with 6 additions and 0 deletions
|
|
@ -1101,6 +1101,9 @@ composition_compute_stop_pos (struct composition_it *cmp_it, ptrdiff_t charpos,
|
|||
|
||||
/* Look for automatic compositions. */
|
||||
start = charpos;
|
||||
/* For the case that they set it to something weird, like nil. */
|
||||
if (!CHAR_TABLE_P (Vcomposition_function_table))
|
||||
Vcomposition_function_table = Fmake_char_table (Qnil, Qnil);
|
||||
if (charpos < endpos)
|
||||
{
|
||||
/* Forward search. */
|
||||
|
|
@ -1324,6 +1327,9 @@ composition_reseat_it (struct composition_it *cmp_it, ptrdiff_t charpos,
|
|||
Lisp_Object lgstring = Qnil;
|
||||
Lisp_Object val, elt, direction = Qnil;
|
||||
|
||||
/* For the case that they set it to something weird, like nil. */
|
||||
if (!CHAR_TABLE_P (Vcomposition_function_table))
|
||||
Vcomposition_function_table = Fmake_char_table (Qnil, Qnil);
|
||||
val = CHAR_TABLE_REF (Vcomposition_function_table, cmp_it->ch);
|
||||
for (EMACS_INT i = 0; i < cmp_it->rule_idx; i++, val = XCDR (val))
|
||||
continue;
|
||||
|
|
|
|||
Loading…
Reference in a new issue