]> git.eshelyaron.com Git - emacs.git/commitdiff
Prevent another abort in 'cmcheckmagic'
authorEli Zaretskii <eliz@gnu.org>
Thu, 6 Jun 2024 14:43:00 +0000 (17:43 +0300)
committerEshel Yaron <me@eshelyaron.com>
Fri, 7 Jun 2024 10:44:16 +0000 (12:44 +0200)
* src/dispnew.c (update_frame_line): Prevent rare aborts when TTY
frame is resized.  (Bug#71289)

(cherry picked from commit 91f51f5ac5e6343359ffcadc8341b8da767aab87)

src/dispnew.c

index a3c5cbbcf00d81ad1be2cc8ffe5711cc6c9f45ed..8223b90f4a45256f18e976bbff3e28f73330bc92 100644 (file)
@@ -5263,6 +5263,11 @@ update_frame_line (struct frame *f, int vpos, bool updating_menu_p)
   bool colored_spaces_p = (FACE_FROM_ID (f, DEFAULT_FACE_ID)->background
                           != FACE_TTY_DEFAULT_BG_COLOR);
 
+  /* This should never happen, but evidently sometimes does if one
+     resizes the frame quickly enough.  Prevent aborts in cmcheckmagic.  */
+  if (vpos >= FRAME_LINES (f))
+    return;
+
   if (colored_spaces_p)
     write_spaces_p = 1;