From bc3de6d340f1f673a714181ffa0d8fa58e39cb7b Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 3 Jun 2024 21:13:05 +0300 Subject: [PATCH] Avoid assertion violations in 'try_window_id' * src/xdisp.c (try_window_id): Avoid assertions in 'find_first_unchanged_at_end_row' due to 'init_iterator' freeing all the realized faces. (Bug#71274) (cherry picked from commit 642bf58d4fbff4493b629837564b7e5c77c7615c) --- src/xdisp.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index 47675fcc80a..3d8651f4086 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -22337,6 +22337,13 @@ try_window_id (struct window *w) start_pos = it.current.pos; } + /* init_to_row_end and start_display above could have caused the + window's window_end_valid flag to be reset (e.g., if init_iterator + decides to free all realized faces). We cannot continue if that + happens. */ + if (!w->window_end_valid) + GIVE_UP (108); + /* Find the first row that is not affected by changes at the end of the buffer. Value will be null if there is no unchanged row, in which case we must redisplay to the end of the window. delta -- 2.39.2