From: Eli Zaretskii Date: Sat, 25 Feb 2023 15:19:15 +0000 (+0200) Subject: Fix infloop in bidi.c X-Git-Tag: emacs-29.0.90~320 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=ab0cc4e7811;p=emacs.git Fix infloop in bidi.c * src/bidi.c (bidi_set_paragraph_end): Reset the isolate_level to zero. Whenever stack_idx is reset to zero, the isolate_level must also be reset, since there cannot be any isolate status outside of embeddings. Failure to reset isolate_level will cause us infloop when we see a PDI. Reported by Matt Beshara . --- diff --git a/src/bidi.c b/src/bidi.c index 93875d243e4..3c26ae19322 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1126,6 +1126,7 @@ bidi_set_paragraph_end (struct bidi_it *bidi_it) bidi_it->invalid_levels = 0; bidi_it->invalid_isolates = 0; bidi_it->stack_idx = 0; + bidi_it->isolate_level = 0; bidi_it->resolved_level = bidi_it->level_stack[0].level; }