From 3b8dda6c903e8e103a26ce812fc9400b301a09ae Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sun, 3 Oct 2021 20:30:26 -0700 Subject: [PATCH] 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. --- src/xmenu.c | 8 ++++++++ 1 file changed, 8 insertions(+) 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)) -- 2.39.5