emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] trunk r113778: Fix bug #15064 with assertion violation due


From: Eli Zaretskii
Subject: [Emacs-diffs] trunk r113778: Fix bug #15064 with assertion violation due to mouse face.
Date: Fri, 09 Aug 2013 21:20:12 +0000
User-agent: Bazaar (2.6b2)

------------------------------------------------------------
revno: 113778
revision-id: address@hidden
parent: address@hidden
fixes bug: http://debbugs.gnu.org/15064
committer: Eli Zaretskii <address@hidden>
branch nick: trunk
timestamp: Sat 2013-08-10 00:19:42 +0300
message:
  Fix bug #15064 with assertion violation due to mouse face.
  
   src/xdisp.c (draw_glyphs): Don't compare row pointers, compare row
   vertical positions instead.  This avoids calling MATRIX_ROW with
   row numbers that are possibly beyond valid limits.
modified:
  src/ChangeLog                  changelog-20091113204419-o5vbwnq5f7feedwu-1438
  src/xdisp.c                    xdisp.c-20091113204419-o5vbwnq5f7feedwu-240
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-08-09 12:25:34 +0000
+++ b/src/ChangeLog     2013-08-09 21:19:42 +0000
@@ -1,3 +1,9 @@
+2013-08-09  Eli Zaretskii  <address@hidden>
+
+       * xdisp.c (draw_glyphs): Don't compare row pointers, compare row
+       vertical positions instead.  This avoids calling MATRIX_ROW with
+       row numbers that are possibly beyond valid limits.  (Bug#15064)
+
 2013-08-09  Dmitry Antipov  <address@hidden>
 
        Use xstrdup and build_unibyte_string where applicable.

=== modified file 'src/xdisp.c'
--- a/src/xdisp.c       2013-08-09 12:25:34 +0000
+++ b/src/xdisp.c       2013-08-09 21:19:42 +0000
@@ -23826,17 +23826,15 @@
          && hlinfo->mouse_face_beg_row >= 0
          && hlinfo->mouse_face_end_row >= 0)
        {
-         struct glyph_row *mouse_beg_row, *mouse_end_row;
-
-         mouse_beg_row = MATRIX_ROW (w->current_matrix, 
hlinfo->mouse_face_beg_row);
-         mouse_end_row = MATRIX_ROW (w->current_matrix, 
hlinfo->mouse_face_end_row);
-
-         if (row >= mouse_beg_row && row <= mouse_end_row)
+         ptrdiff_t row_vpos = MATRIX_ROW_VPOS (row, w->current_matrix);
+
+         if (row_vpos >= hlinfo->mouse_face_beg_row
+             && row_vpos <= hlinfo->mouse_face_end_row)
            {
              check_mouse_face = 1;
-             mouse_beg_col = (row == mouse_beg_row)
+             mouse_beg_col = (row_vpos == hlinfo->mouse_face_beg_row)
                ? hlinfo->mouse_face_beg_col : 0;
-             mouse_end_col = (row == mouse_end_row)
+             mouse_end_col = (row_vpos == hlinfo->mouse_face_end_row)
                ? hlinfo->mouse_face_end_col
                : row->used[TEXT_AREA];
            }


reply via email to

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