Avoid assertion violations in 'pop_it'

* src/xdisp.c (pop_it): Avoid assertion violations when handling
lists or vectors of display properties.  (Bug#58122)
This commit is contained in:
Eli Zaretskii 2022-09-28 16:46:39 +03:00
parent 72aac80184
commit b1e92c59ed

View file

@ -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