summaryrefslogtreecommitdiff
path: root/src/xmenu.c
diff options
context:
space:
mode:
authorPaul Eggert <eggert@cs.ucla.edu>2021-10-03 20:30:26 -0700
committerPaul Eggert <eggert@cs.ucla.edu>2021-10-03 20:30:55 -0700
commit3b8dda6c903e8e103a26ce812fc9400b301a09ae (patch)
treebd343234fcc24ab12886d4c721db7b30d189c422 /src/xmenu.c
parente1fb731393f0f47a910836915c410989c8d06a8f (diff)
downloademacs-3b8dda6c903e8e103a26ce812fc9400b301a09ae.tar.gz
Add safety check in x_menu_show
* src/xmenu.c (x_menu_show): Explicitly check whether save_wv can be null here. Looks like it can be but I am not 100% sure, so play it safe and add a FIXME comment.
Diffstat (limited to 'src/xmenu.c')
-rw-r--r--src/xmenu.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/xmenu.c b/src/xmenu.c
index a6762236bc4..709e455dd05 100644
--- a/src/xmenu.c
+++ b/src/xmenu.c
@@ -1603,6 +1603,14 @@ x_menu_show (struct frame *f, int x, int y, int menuflags,
STRINGP (help) ? help : Qnil);
if (prev_wv)
prev_wv->next = wv;
+ else if (!save_wv)
+ {
+ /* This call to 'abort' pacifies gcc 11.2.1 when Emacs
+ is configured with --enable-gcc-warnings. FIXME: If
+ save_wv can be null, do something better; otherwise,
+ explain why save_wv cannot be null. */
+ abort ();
+ }
else
save_wv->contents = wv;
if (!NILP (descrip))