Skip to content

Commit

Permalink
Avoid assertion violations in 'lookup-key'
Browse files Browse the repository at this point in the history
* src/keymap.c (Flookup_key): Don't call ASIZE unless KEY is a
vector.  This avoids assertion violations when KEY is a string.
  • Loading branch information
Eli-Zaretskii committed Oct 28, 2021
1 parent f52fa1c commit bea843d
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/keymap.c
Expand Up @@ -1253,8 +1253,8 @@ recognize the default bindings, just as `read-key-sequence' does. */)
/* Menu definitions might use mixed case symbols (notably in old
versions of `easy-menu-define'). We accept this variation for
backwards-compatibility. (Bug#50752) */
ptrdiff_t key_len = ASIZE (key);
if (VECTORP (key) && key_len > 0 && EQ (AREF (key, 0), Qmenu_bar))
ptrdiff_t key_len = VECTORP (key) ? ASIZE (key) : 0;
if (key_len > 0 && EQ (AREF (key, 0), Qmenu_bar))
{
Lisp_Object new_key = make_vector (key_len, Qnil);
for (int i = 0; i < key_len; ++i)
Expand Down

0 comments on commit bea843d

Please sign in to comment.