]> code.delx.au - gnu-emacs/commitdiff
Fix an assertion
authorChris Feng <chris.w.feng@gmail.com>
Thu, 25 Feb 2016 01:34:55 +0000 (09:34 +0800)
committerChris Feng <chris.w.feng@gmail.com>
Thu, 25 Feb 2016 01:34:55 +0000 (09:34 +0800)
* src/dispnew.c (clear_glyph_matrix_rows): Test matrix->nrows == 0 (which
implies start == 0) separately.

src/dispnew.c

index f96db302781bba543bb451f0d070d1d3b1a9cb6f..f834f359ec5d76b1a6c82207c6ab24c950348fa0 100644 (file)
@@ -683,7 +683,9 @@ void
 clear_glyph_matrix_rows (struct glyph_matrix *matrix, int start, int end)
 {
   eassert (start <= end);
-  eassert (start >= 0 && start <= matrix->nrows);
+  eassert (start >= 0 && (start < matrix->nrows
+                         /* matrix->nrows can be 0 for the initial frame.  */
+                         || (matrix->nrows == 0)));
   eassert (end >= 0 && end <= matrix->nrows);
 
   for (; start < end; ++start)