]> git.eshelyaron.com Git - emacs.git/commitdiff
Avoid assertion violations in 'handle_fontified_prop'
authorEli Zaretskii <eliz@gnu.org>
Fri, 22 Jul 2022 19:22:08 +0000 (22:22 +0300)
committerEli Zaretskii <eliz@gnu.org>
Fri, 22 Jul 2022 19:22:08 +0000 (22:22 +0300)
* src/xdisp.c (handle_fontified_prop): Avoid assertion violations
due to automatic narrowing.  (Bug#56682)

src/xdisp.c

index caa421c28185637dafea22907fb87a41acc74c66..215a6d561ea95388c5fc62238daba55ce0a84d20 100644 (file)
@@ -4395,6 +4395,11 @@ handle_fontified_prop (struct it *it)
       bool old_clip_changed = current_buffer->clip_changed;
       bool saved_inhibit_flag = it->f->inhibit_clear_image_cache;
 
+      val = Vfontification_functions;
+      specbind (Qfontification_functions, Qnil);
+
+      eassert (it->end_charpos == ZV);
+
       if (it->narrowed_begv)
        {
          record_unwind_protect (unwind_narrowed_begv, Fpoint_min ());
@@ -4404,11 +4409,6 @@ handle_fontified_prop (struct it *it)
          specbind (Qinhibit_widen, Qt);
        }
 
-      val = Vfontification_functions;
-      specbind (Qfontification_functions, Qnil);
-
-      eassert (it->end_charpos == ZV);
-
       /* Don't allow Lisp that runs from 'fontification-functions'
         clear our face and image caches behind our back.  */
       it->f->inhibit_clear_image_cache = true;