[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
emacs-28 bea843d: Avoid assertion violations in 'lookup-key'
From: |
Eli Zaretskii |
Subject: |
emacs-28 bea843d: Avoid assertion violations in 'lookup-key' |
Date: |
Thu, 28 Oct 2021 13:53:44 -0400 (EDT) |
branch: emacs-28
commit bea843dee19f2ac69f0d7a753d3bd917760a0344
Author: Eli Zaretskii <eliz@gnu.org>
Commit: Eli Zaretskii <eliz@gnu.org>
Avoid assertion violations in 'lookup-key'
* src/keymap.c (Flookup_key): Don't call ASIZE unless KEY is a
vector. This avoids assertion violations when KEY is a string.
---
src/keymap.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/src/keymap.c b/src/keymap.c
index f7529f8..50f896d 100644
--- a/src/keymap.c
+++ b/src/keymap.c
@@ -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)
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- emacs-28 bea843d: Avoid assertion violations in 'lookup-key',
Eli Zaretskii <=