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.
This commit is contained in:
Paul Eggert 2021-10-03 20:30:26 -07:00
parent e1fb731393
commit 3b8dda6c90

View file

@ -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))