Commit dba8296c authored by Eli Zaretskii's avatar Eli Zaretskii
Browse files

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.
parent 44a2be2d
...@@ -2,6 +2,9 @@ ...@@ -2,6 +2,9 @@
* xdisp.c (init_iterator): Don't dereference a bogus face * xdisp.c (init_iterator): Don't dereference a bogus face
pointer. (Bug#16819) 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 <rgm@gnu.org> 2014-02-20 Glenn Morris <rgm@gnu.org>
......
...@@ -15470,29 +15470,32 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste ...@@ -15470,29 +15470,32 @@ try_cursor_movement (Lisp_Object window, struct text_pos startp, int *scroll_ste
/* As soon as we've found the exact match for point, /* As soon as we've found the exact match for point,
or the first suitable row whose ends_at_zv_p flag or the first suitable row whose ends_at_zv_p flag
is set, we are done. */ is set, we are done. */
at_zv_p = if (rv)
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))
{ {
struct glyph_row *candidate = at_zv_p = MATRIX_ROW (w->current_matrix,
MATRIX_ROW (w->current_matrix, w->cursor.vpos); w->cursor.vpos)->ends_at_zv_p;
struct glyph *g = if (!at_zv_p
candidate->glyphs[TEXT_AREA] + w->cursor.hpos; && w->cursor.hpos >= 0
ptrdiff_t endpos = MATRIX_ROW_END_CHARPOS (candidate); && w->cursor.hpos < MATRIX_ROW_USED (w->current_matrix,
w->cursor.vpos))
exact_match_p = {
(BUFFERP (g->object) && g->charpos == PT) struct glyph_row *candidate =
|| (INTEGERP (g->object) MATRIX_ROW (w->current_matrix, w->cursor.vpos);
&& (g->charpos == PT struct glyph *g =
|| (g->charpos == 0 && endpos - 1 == PT))); candidate->glyphs[TEXT_AREA] + w->cursor.hpos;
} ptrdiff_t endpos = MATRIX_ROW_END_CHARPOS (candidate);
if (rv && (at_zv_p || exact_match_p))
{ exact_match_p =
rc = CURSOR_MOVEMENT_SUCCESS; (BUFFERP (g->object) && g->charpos == PT)
break; || (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) if (MATRIX_ROW_BOTTOM_Y (row) == last_y)
break; break;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment