emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] trunk r116493: Fix assertion violation in redisplay.


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r116493: Fix assertion violation in redisplay.
Date: Thu, 20 Feb 2014 17:18:25 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 116493
revision-id: address@hidden
parent: address@hidden
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Thu 2014-02-20 19:17:54 +0200
message:
  Fix assertion violation in redisplay.
  
   src/xdisp.c (try_cursor_movement): Don't use cursor position if
   set_cursor_from_row failed to compute it.  This avoids assertion
   violations in MATRIX_ROW.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2014-02-20 17:13:55 +0000
+++ b/src/ChangeLog     2014-02-20 17:17:54 +0000
@@ -2,6 +2,9 @@
 
        * xdisp.c (init_iterator): Don't dereference a bogus face
        pointer.  (Bug#16819)
+       (try_cursor_movement): Don't use cursor position if
+       set_cursor_from_row failed to compute it.  This avoids assertion
+       violations in MATRIX_ROW.
 
 2014-02-20  Glenn Morris  <address@hidden>
 

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2014-02-20 17:13:55 +0000
+++ b/src/xdisp.c       2014-02-20 17:17:54 +0000
@@ -15470,29 +15470,32 @@
                  /* As soon as we've found the exact match for point,
                     or the first suitable row whose ends_at_zv_p flag
                     is set, we are done.  */
-                 at_zv_p =
-                   MATRIX_ROW (w->current_matrix, 
w->cursor.vpos)->ends_at_zv_p;
-                 if (rv && !at_zv_p
-                     && w->cursor.hpos >= 0
-                     && w->cursor.hpos < MATRIX_ROW_USED (w->current_matrix,
-                                                          w->cursor.vpos))
+                 if (rv)
                    {
-                     struct glyph_row *candidate =
-                       MATRIX_ROW (w->current_matrix, w->cursor.vpos);
-                     struct glyph *g =
-                       candidate->glyphs[TEXT_AREA] + w->cursor.hpos;
-                     ptrdiff_t endpos = MATRIX_ROW_END_CHARPOS (candidate);
+                     at_zv_p = MATRIX_ROW (w->current_matrix,
+                                           w->cursor.vpos)->ends_at_zv_p;
+                     if (!at_zv_p
+                         && w->cursor.hpos >= 0
+                         && w->cursor.hpos < MATRIX_ROW_USED 
(w->current_matrix,
+                                                              w->cursor.vpos))
+                       {
+                         struct glyph_row *candidate =
+                           MATRIX_ROW (w->current_matrix, w->cursor.vpos);
+                         struct glyph *g =
+                           candidate->glyphs[TEXT_AREA] + w->cursor.hpos;
+                         ptrdiff_t endpos = MATRIX_ROW_END_CHARPOS (candidate);
 
-                     exact_match_p =
-                       (BUFFERP (g->object) && g->charpos == PT)
-                       || (INTEGERP (g->object)
-                           && (g->charpos == PT
-                               || (g->charpos == 0 && endpos - 1 == PT)));
-                   }
-                 if (rv && (at_zv_p || exact_match_p))
-                   {
-                     rc = CURSOR_MOVEMENT_SUCCESS;
-                     break;
+                         exact_match_p =
+                           (BUFFERP (g->object) && g->charpos == PT)
+                           || (INTEGERP (g->object)
+                               && (g->charpos == PT
+                                   || (g->charpos == 0 && endpos - 1 == PT)));
+                       }
+                     if (at_zv_p || exact_match_p)
+                       {
+                         rc = CURSOR_MOVEMENT_SUCCESS;
+                         break;
+                       }
                    }
                  if (MATRIX_ROW_BOTTOM_Y (row) == last_y)
                    break;


reply via email to

[Prev in Thread] Current Thread [Next in Thread]