Avoid rare segfaults in 'check_matrix_pointers'

* src/dispnew.c (check_window_matrix_pointers): No-op if the
window's frame not ready yet.  (Bug#77200)
This commit is contained in:
Eli Zaretskii 2025-03-23 11:30:17 +02:00
parent ab25b4fca9
commit e20e853861

View file

@ -3113,18 +3113,22 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy
static void
check_window_matrix_pointers (struct window *w)
{
while (w)
{
if (WINDOWP (w->contents))
check_window_matrix_pointers (XWINDOW (w->contents));
else
{
struct frame *f = XFRAME (w->frame);
check_matrix_pointers (w->desired_matrix, f->desired_matrix);
check_matrix_pointers (w->current_matrix, f->current_matrix);
}
struct frame *f = XFRAME (w->frame);
w = NILP (w->next) ? 0 : XWINDOW (w->next);
if (f->after_make_frame)
{
while (w)
{
if (WINDOWP (w->contents))
check_window_matrix_pointers (XWINDOW (w->contents));
else
{
check_matrix_pointers (w->desired_matrix, f->desired_matrix);
check_matrix_pointers (w->current_matrix, f->current_matrix);
}
w = NILP (w->next) ? 0 : XWINDOW (w->next);
}
}
}