]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix bug #15064 with assertion violation due to mouse face.
authorEli Zaretskii <eliz@gnu.org>
Fri, 9 Aug 2013 21:19:42 +0000 (00:19 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 9 Aug 2013 21:19:42 +0000 (00:19 +0300)
 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.

src/ChangeLog
src/xdisp.c

index bd8aae80d5de5efa733bc19e992d1dd0bedaeb67..642b6b322318fc292c532f2709cc7906361d0fc5 100644 (file)
@@ -1,3 +1,9 @@
+2013-08-09  Eli Zaretskii  <eliz@gnu.org>
+
+       * 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  <dmantipov@yandex.ru>
 
        Use xstrdup and build_unibyte_string where applicable.
index aee24e27d525823c1eca1e20fff81d683a8e0a03..35abf71e5bfe24023f0e2c23cbefeb87224cac73 100644 (file)
@@ -23826,17 +23826,15 @@ draw_glyphs (struct window *w, int x, struct glyph_row *row,
          && hlinfo->mouse_face_beg_row >= 0
          && hlinfo->mouse_face_end_row >= 0)
        {
-         struct glyph_row *mouse_beg_row, *mouse_end_row;
+         ptrdiff_t row_vpos = MATRIX_ROW_VPOS (row, w->current_matrix);
 
-         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)
+         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];
            }