emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

emacs-28 3b8dda6: Add safety check in x_menu_show


From: Paul Eggert
Subject: emacs-28 3b8dda6: Add safety check in x_menu_show
Date: Sun, 3 Oct 2021 23:31:13 -0400 (EDT)

branch: emacs-28
commit 3b8dda6c903e8e103a26ce812fc9400b301a09ae
Author: Paul Eggert <eggert@cs.ucla.edu>
Commit: Paul Eggert <eggert@cs.ucla.edu>

    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 a6762236..709e455 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))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]