From 14ea76af5f3596d48747c2437006f6e1abcb67a7 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Mon, 7 Aug 2017 20:47:53 +0300 Subject: [PATCH] Fix infinite recursion under prettify-symbols-mode and linum-mode * src/xdisp.c (get_overlay_strings_1) (handle_single_display_spec, push_prefix_prop): Invalidate the composition information before starting to iterate on a string. Otherwise we might think in set_iterator_to_next that we are delivering characters from a composition, and do all kinds of nonsensical things, like over-step the string end. (Bug#27761) --- src/xdisp.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/xdisp.c b/src/xdisp.c index 422912e57a6..ad9b29835e7 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -5248,6 +5248,7 @@ handle_single_display_spec (struct it *it, Lisp_Object spec, Lisp_Object object, it->prev_stop = 0; it->base_level_stop = 0; it->string_from_display_prop_p = true; + it->cmp_it.id = -1; /* Say that we haven't consumed the characters with `display' property yet. The call to pop_it in set_iterator_to_next will clean this up. */ @@ -5966,6 +5967,7 @@ get_overlay_strings_1 (struct it *it, ptrdiff_t charpos, bool compute_stop_p) it->multibyte_p = STRING_MULTIBYTE (it->string); it->method = GET_FROM_STRING; it->from_disp_prop_p = 0; + it->cmp_it.id = -1; /* Force paragraph direction to be that of the parent buffer. */ @@ -20506,6 +20508,7 @@ push_prefix_prop (struct it *it, Lisp_Object prop) it->stop_charpos = 0; it->prev_stop = 0; it->base_level_stop = 0; + it->cmp_it.id = -1; /* Force paragraph direction to be that of the parent buffer/string. */ -- 2.11.4.GIT