Commit 6469f9cd authored by Eli Zaretskii's avatar Eli Zaretskii

Fix crashes on TTY frames due to "C-x 6 f"

* src/xdisp.c (redisplay_internal): Revert the recent change
regarding TTY frames' garbaged flag.  It is not needed.

* src/dispnew.c (adjust_frame_glyphs_for_frame_redisplay):
When returning due to mismatch between the desired and actual
dimensions of the glyph matrix, set the frame's garbaged flag
for TTY frames.  This avoids crashes when we are later called
from redisplay.  Reported by Ergus <spacibba@aol.com>.
parent 304d022a
Pipeline #3508 passed with stage
in 84 minutes and 44 seconds
......@@ -2051,7 +2051,19 @@ adjust_frame_glyphs_for_frame_redisplay (struct frame *f)
to the frame width (from CHANGE_FRAME_SIZE_1). */
if (matrix_dim.width != FRAME_TOTAL_COLS (f)
|| matrix_dim.height != FRAME_TOTAL_LINES (f))
return;
{
/* We have reallocated the frame's glyph pools, but didn't
update the glyph pointers in the frame's glyph matrices
to use the reallocated pools (that happens below, in the
call to adjust_glyph_matrix). Set the frame's garbaged
flag, so that when we are called again from
redisplay_internal, we don't erroneously call
save_current_matrix, because it will use the wrong glyph
pointers, and will most probably crash. */
if (!FRAME_WINDOW_P (f) && pool_changed_p)
SET_FRAME_GARBAGED (f);
return;
}
eassert (matrix_dim.width == FRAME_TOTAL_COLS (f)
&& matrix_dim.height == FRAME_TOTAL_LINES (f));
......
......@@ -15684,7 +15684,7 @@ redisplay_internal (void)
the frame. Don't do that on TTY frames, since we
need to keep the garbaged flag in that case when
the frame has been resized. */
if (FRAME_WINDOW_P (f) && FRAME_GARBAGED_P (f))
if (FRAME_GARBAGED_P (f))
{
fset_redisplay (f);
f->garbaged = false;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment