Fix random crashes while scrolling backwards.
authorEli Zaretskii <eliz@gnu.org>
Sun, 30 Oct 2011 18:07:48 +0000 (20:07 +0200)
committerEli Zaretskii <eliz@gnu.org>
Sun, 30 Oct 2011 18:07:48 +0000 (20:07 +0200)
 src/xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
 past the beginning of the current glyph matrix.

src/ChangeLog
src/xdisp.c

index 9f8fa94..0bb1651 100644 (file)
@@ -1,3 +1,8 @@
+2011-10-30  Eli Zaretskii  <eliz@gnu.org>
+
+       * xdisp.c (try_cursor_movement): Make sure ROW isn't decremented
+       past the beginning of the current glyph matrix.
+
 2011-10-30  Adam Sjøgren <asjo@koldfront.dk> (tiny change)
 
        * xterm.c: Include X11/Xproto.h if HAVE_GTK3.
index 22f7c2b..33c5fc0 100644 (file)
@@ -14829,8 +14829,6 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
                 bidi-reordered rows.  */
              while (MATRIX_ROW_CONTINUATION_LINE_P (row))
                {
-                 xassert (row->enabled_p);
-                 --row;
                  /* If we hit the beginning of the displayed portion
                     without finding the first row of a continued
                     line, give up.  */
@@ -14839,7 +14837,8 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
                      rc = CURSOR_MOVEMENT_MUST_SCROLL;
                      break;
                    }
-
+                 xassert (row->enabled_p);
+                 --row;
                }
            }
          if (must_scroll)