From: Gerd Möllmann Date: Wed, 28 Sep 2022 14:38:04 +0000 (+0200) Subject: Avoid nested iteration over intervals (bug#58144) X-Git-Tag: emacs-29.0.90~1616^2~406^2~54 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=17ba7ac5d9295d39ec3b97712d061b3c7866a093;p=emacs.git Avoid nested iteration over intervals (bug#58144) * src/xdisp.c (strings_with_newlines): Call buffer_overlay_iter_finish. --- diff --git a/src/xdisp.c b/src/xdisp.c index cee75def804..6ecd3bdf24f 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -7031,13 +7031,21 @@ strings_with_newlines (ptrdiff_t startpos, ptrdiff_t endpos, struct window *w) str = Foverlay_get (overlay, Qbefore_string); if (STRINGP (str) && SCHARS (str) && memchr (SDATA (str), '\n', SBYTES (str))) - return true; + { + buffer_overlay_iter_finish (current_buffer); + return true; + } str = Foverlay_get (overlay, Qafter_string); if (STRINGP (str) && SCHARS (str) && memchr (SDATA (str), '\n', SBYTES (str))) - return true; + { + buffer_overlay_iter_finish (current_buffer); + return true; + } } + buffer_overlay_iter_finish (current_buffer); + /* Check for 'display' properties whose values include strings. */ Lisp_Object cpos = make_fixnum (startpos); Lisp_Object limpos = make_fixnum (endpos);