diff options
| author | Eli Zaretskii | 2025-03-23 11:30:17 +0200 |
|---|---|---|
| committer | Eli Zaretskii | 2025-03-23 11:30:17 +0200 |
| commit | e20e8538610ed8b78e0b9f9cc3121c1102a8aaf0 (patch) | |
| tree | 193e6f259d4f43601952aa3d4aeba8bd87557692 /src | |
| parent | ab25b4fca9a20ccc03a90ec9c2281a2f88872d93 (diff) | |
| download | emacs-e20e8538610ed8b78e0b9f9cc3121c1102a8aaf0.tar.gz emacs-e20e8538610ed8b78e0b9f9cc3121c1102a8aaf0.zip | |
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)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dispnew.c | 22 |
1 files changed, 13 insertions, 9 deletions
diff --git a/src/dispnew.c b/src/dispnew.c index 6365dcb9c4d..6cd41620b57 100644 --- a/src/dispnew.c +++ b/src/dispnew.c | |||
| @@ -3113,18 +3113,22 @@ mirror_line_dance (struct window *w, int unchanged_at_top, int nlines, int *copy | |||
| 3113 | static void | 3113 | static void |
| 3114 | check_window_matrix_pointers (struct window *w) | 3114 | check_window_matrix_pointers (struct window *w) |
| 3115 | { | 3115 | { |
| 3116 | while (w) | 3116 | struct frame *f = XFRAME (w->frame); |
| 3117 | |||
| 3118 | if (f->after_make_frame) | ||
| 3117 | { | 3119 | { |
| 3118 | if (WINDOWP (w->contents)) | 3120 | while (w) |
| 3119 | check_window_matrix_pointers (XWINDOW (w->contents)); | ||
| 3120 | else | ||
| 3121 | { | 3121 | { |
| 3122 | struct frame *f = XFRAME (w->frame); | 3122 | if (WINDOWP (w->contents)) |
| 3123 | check_matrix_pointers (w->desired_matrix, f->desired_matrix); | 3123 | check_window_matrix_pointers (XWINDOW (w->contents)); |
| 3124 | check_matrix_pointers (w->current_matrix, f->current_matrix); | 3124 | else |
| 3125 | } | 3125 | { |
| 3126 | check_matrix_pointers (w->desired_matrix, f->desired_matrix); | ||
| 3127 | check_matrix_pointers (w->current_matrix, f->current_matrix); | ||
| 3128 | } | ||
| 3126 | 3129 | ||
| 3127 | w = NILP (w->next) ? 0 : XWINDOW (w->next); | 3130 | w = NILP (w->next) ? 0 : XWINDOW (w->next); |
| 3131 | } | ||
| 3128 | } | 3132 | } |
| 3129 | } | 3133 | } |
| 3130 | 3134 | ||