summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChris Feng <chris.w.feng@gmail.com>2016-02-25 09:34:55 +0800
committerChris Feng <chris.w.feng@gmail.com>2016-02-25 09:34:55 +0800
commit8be32cf45cd8b39ff6c8dc431b0ac04a0959786d (patch)
tree02553e0b9f3545619cb8ab7bf1b6bc6902174470
parent040e0d6b3b9e7222707ba96a57f3abeef1f5fe88 (diff)
downloademacs-8be32cf45cd8b39ff6c8dc431b0ac04a0959786d.tar.gz
Fix an assertion
* src/dispnew.c (clear_glyph_matrix_rows): Test matrix->nrows == 0 (which implies start == 0) separately.
-rw-r--r--src/dispnew.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/dispnew.c b/src/dispnew.c
index f96db302781..f834f359ec5 100644
--- a/src/dispnew.c
+++ b/src/dispnew.c
@@ -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)