# HG changeset patch # User Eli Zaretskii # Date 1271679133 -10800 # Node ID e4d7764c4cbebc547e2f135130d666cb74cc8615 # Parent 6eae3bc103308922a79cae2438d2eb905992433b Fix crashes in GC in "emacs -nw". xdisp.c (display_line): Don't write beyond the last glyph row in the desired matrix. Fixes crashes in "emacs -nw", see http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00075.html and http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00213.html diff -r 6eae3bc10330 -r e4d7764c4cbe src/ChangeLog --- a/src/ChangeLog Sun Apr 18 22:32:47 2010 -0400 +++ b/src/ChangeLog Mon Apr 19 15:12:13 2010 +0300 @@ -1,3 +1,11 @@ +2010-04-19 Eli Zaretskii + + * xdisp.c (display_line): Don't write beyond the last glyph row in + the desired matrix. Fixes a crash in "emacs -nw", see + http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00075.html + and + http://lists.gnu.org/archive/html/emacs-devel/2010-04/msg00213.html + 2010-04-18 Stefan Monnier * alloc.c (Fpurecopy): Hash-cons if requested. diff -r 6eae3bc10330 -r e4d7764c4cbe src/xdisp.c --- a/src/xdisp.c Sun Apr 18 22:32:47 2010 -0400 +++ b/src/xdisp.c Mon Apr 19 15:12:13 2010 +0300 @@ -17808,10 +17808,12 @@ it->current_y += row->height; ++it->vpos; ++it->glyph_row; - /* The next row should use same value of the reversed_p flag as this - one. set_iterator_to_next decides when it's a new paragraph, and - PRODUCE_GLYPHS recomputes the value of the flag accordingly. */ - it->glyph_row->reversed_p = row->reversed_p; + /* The next row should by default use the same value of the + reversed_p flag as this one. set_iterator_to_next decides when + it's a new paragraph, and PRODUCE_GLYPHS recomputes the value of + the flag accordingly. */ + if (it->glyph_row < MATRIX_BOTTOM_TEXT_ROW (it->w->desired_matrix, it->w)) + it->glyph_row->reversed_p = row->reversed_p; it->start = row_end; return row->displays_text_p; }