From: Eli Zaretskii Date: Tue, 8 Mar 2022 13:35:39 +0000 (+0200) Subject: Avoid assertion violations in 'bidi_resolve_brackets' X-Git-Tag: emacs-28.0.92~5 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=d184773;p=emacs.git Avoid assertion violations in 'bidi_resolve_brackets' * src/bidi.c (bidi_resolve_brackets): Move assertion to where it really matters. (Bug#54295) --- diff --git a/src/bidi.c b/src/bidi.c index a548960048a..9449e099446 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -2921,13 +2921,13 @@ bidi_resolve_brackets (struct bidi_it *bidi_it) int embedding_level = bidi_it->level_stack[bidi_it->stack_idx].level; bidi_type_t embedding_type = (embedding_level & 1) ? STRONG_R : STRONG_L; - eassert (bidi_it->prev_for_neutral.type != UNKNOWN_BT); eassert (bidi_it->bracket_pairing_pos > bidi_it->charpos); if (bidi_it->bracket_enclosed_type == embedding_type) /* N0b */ type = embedding_type; else if (bidi_it->bracket_enclosed_type == STRONG_L /* N0c, N0d */ || bidi_it->bracket_enclosed_type == STRONG_R) { + eassert (bidi_it->prev_for_neutral.type != UNKNOWN_BT); switch (bidi_it->prev_for_neutral.type) { case STRONG_R: @@ -2946,7 +2946,6 @@ bidi_resolve_brackets (struct bidi_it *bidi_it) break; default: /* N0d: Do not set the type for that bracket pair. */ - /* (Actuallly, this shouldn't happen.) */ break; } }