From: Paul Eggert Date: Mon, 4 Oct 2021 03:30:26 +0000 (-0700) Subject: Add safety check in x_menu_show X-Git-Tag: emacs-28.0.90~421 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3b8dda6c903e8e103a26ce812fc9400b301a09ae;p=emacs.git 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. --- 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))