]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid a risky corner case with invalid face ids.
authorChong Yidong <cyd@gnu.org>
Sun, 12 Feb 2012 09:46:33 +0000 (17:46 +0800)
committerChong Yidong <cyd@gnu.org>
Sun, 12 Feb 2012 09:46:33 +0000 (17:46 +0800)
* src/xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
as that creates a dangerous corner case.

src/ChangeLog
src/xdisp.c

index 0ded1fc7a6714af347fae497ad03376908982130..1e28d2585234c0abf8feb51e36aa42cf4fc6d86a 100644 (file)
@@ -1,5 +1,8 @@
 2012-02-12  Chong Yidong  <cyd@gnu.org>
 
+       * xdisp.c (handle_stop): Avoid assigning -1 to it->face_id here,
+       as that creates a dangerous corner case.
+
        * window.c (Fdelete_window_internal): Invalidate the mouse
        highlight (Bug#9904).
 
index 75ea519e82e4c3b2ed039335fa87baa397ba2526..70c12497e20516c7a27a181e90b05665cf2dfc4e 100644 (file)
@@ -2750,9 +2750,12 @@ init_iterator (struct it *it, struct window *w,
   if (charpos >= BUF_BEG (current_buffer))
     {
       it->end_charpos = ZV;
-      it->face_id = -1;
       IT_CHARPOS (*it) = charpos;
 
+      /* We will rely on `reseat' to set this up properly, via
+        handle_face_prop.  */
+      it->face_id = it->base_face_id;
+
       /* Compute byte position if not specified.  */
       if (bytepos < charpos)
        IT_BYTEPOS (*it) = CHAR_TO_BYTE (charpos);