Further changes to ensure that copy-keymap doesn't segfault
* src/keymap.c (copy_keymap_1, copy_keymap_set_char_table): Ensure we don't recurse infinitely when using non-sparse keymaps, too. This change makes this form not segfault: (let ((map (make-keymap))) (define-key map " " map) (copy-keymap map))
This commit is contained in:
parent
ea7610f1f1
commit
d1963b312d
1 changed files with 6 additions and 3 deletions
|
|
@ -975,10 +975,12 @@ copy_keymap_item (Lisp_Object elt, int depth)
|
|||
}
|
||||
|
||||
static void
|
||||
copy_keymap_set_char_table (Lisp_Object chartable, Lisp_Object idx,
|
||||
copy_keymap_set_char_table (Lisp_Object chartable_and_depth, Lisp_Object idx,
|
||||
Lisp_Object elt)
|
||||
{
|
||||
Fset_char_table_range (chartable, idx, copy_keymap_item (elt, 0));
|
||||
Fset_char_table_range
|
||||
(XCAR (chartable_and_depth), idx,
|
||||
copy_keymap_item (elt, XFIXNUM (XCDR (chartable_and_depth))));
|
||||
}
|
||||
|
||||
static Lisp_Object
|
||||
|
|
@ -999,7 +1001,8 @@ copy_keymap_1 (Lisp_Object keymap, int depth)
|
|||
if (CHAR_TABLE_P (elt))
|
||||
{
|
||||
elt = Fcopy_sequence (elt);
|
||||
map_char_table (copy_keymap_set_char_table, Qnil, elt, elt);
|
||||
map_char_table (copy_keymap_set_char_table, Qnil, elt,
|
||||
Fcons (elt, make_fixnum (depth + 1)));
|
||||
}
|
||||
else if (VECTORP (elt))
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue