From: Eli Zaretskii Date: Wed, 28 Sep 2022 13:46:39 +0000 (+0300) Subject: Avoid assertion violations in 'pop_it' X-Git-Tag: emacs-28.3-rc1~55 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=b1e92c59ede2e67e36531a35ecb4ccabeaa68ff6;p=emacs.git Avoid assertion violations in 'pop_it' * src/xdisp.c (pop_it): Avoid assertion violations when handling lists or vectors of display properties. (Bug#58122) --- diff --git a/src/xdisp.c b/src/xdisp.c index 6d42105474f..f5f3a811e9d 100644 --- a/src/xdisp.c +++ b/src/xdisp.c @@ -6755,7 +6755,14 @@ pop_it (struct it *it) || (STRINGP (it->object) && IT_STRING_CHARPOS (*it) == it->bidi_it.charpos && IT_STRING_BYTEPOS (*it) == it->bidi_it.bytepos) - || (CONSP (it->object) && it->method == GET_FROM_STRETCH)); + || (CONSP (it->object) && it->method == GET_FROM_STRETCH) + /* We could be in the middle of handling a list or a + vector of several 'display' properties, in which + case we should only verify the above conditions when + we pop the iterator stack the last time, because + higher stack levels cannot "iterate out of the + display property". */ + || it->sp > 0); } /* If we move the iterator over text covered by a display property to a new buffer position, any info about previously seen overlays