aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorEli Zaretskii2024-02-27 13:12:15 +0200
committerEli Zaretskii2024-02-27 13:12:15 +0200
commit383ccf6d51fd7af65dbcc1ce159a03369a48d27f (patch)
treec3cefc3185a74f7518a57f9e0fee19c8330b7757 /src
parentb7cef701cb587ecb66f192e4d41aa202645560e0 (diff)
downloademacs-383ccf6d51fd7af65dbcc1ce159a03369a48d27f.tar.gz
emacs-383ccf6d51fd7af65dbcc1ce159a03369a48d27f.zip
Avoid assertion violations in bidi.c
* src/bidi.c (bidi_resolve_brackets): Move assertion about 'resolved_level' to where it belongs. This avoids unnecessary aborts when the character is not a bracket type and doesn't need BPA resolution. (Bug#69421)
Diffstat (limited to 'src')
-rw-r--r--src/bidi.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/bidi.c b/src/bidi.c
index 93bb061ac32..90c0061549a 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -2908,7 +2908,6 @@ bidi_resolve_brackets (struct bidi_it *bidi_it)
2908 } 2908 }
2909 else if (bidi_it->bracket_pairing_pos != eob) 2909 else if (bidi_it->bracket_pairing_pos != eob)
2910 { 2910 {
2911 eassert (bidi_it->resolved_level == -1);
2912 /* If the cached state shows an increase of embedding level due 2911 /* If the cached state shows an increase of embedding level due
2913 to an isolate initiator, we need to update the 1st cached 2912 to an isolate initiator, we need to update the 1st cached
2914 state of the next run of the current isolating sequence with 2913 state of the next run of the current isolating sequence with
@@ -2917,6 +2916,7 @@ bidi_resolve_brackets (struct bidi_it *bidi_it)
2917 if (bidi_it->level_stack[bidi_it->stack_idx].level > prev_level 2916 if (bidi_it->level_stack[bidi_it->stack_idx].level > prev_level
2918 && ISOLATE_STATUS (bidi_it, bidi_it->stack_idx)) 2917 && ISOLATE_STATUS (bidi_it, bidi_it->stack_idx))
2919 { 2918 {
2919 eassert (bidi_it->resolved_level == -1);
2920 bidi_record_type_for_neutral (&prev_for_neutral, prev_level, 0); 2920 bidi_record_type_for_neutral (&prev_for_neutral, prev_level, 0);
2921 bidi_record_type_for_neutral (&next_for_neutral, prev_level, 1); 2921 bidi_record_type_for_neutral (&next_for_neutral, prev_level, 1);
2922 } 2922 }
@@ -2931,6 +2931,7 @@ bidi_resolve_brackets (struct bidi_it *bidi_it)
2931 } 2931 }
2932 else if (bidi_it->bracket_pairing_pos == -1) 2932 else if (bidi_it->bracket_pairing_pos == -1)
2933 { 2933 {
2934 eassert (bidi_it->resolved_level == -1);
2934 /* Higher levels were not BPA-resolved yet, even if 2935 /* Higher levels were not BPA-resolved yet, even if
2935 cached by bidi_find_bracket_pairs. Force application 2936 cached by bidi_find_bracket_pairs. Force application
2936 of BPA to the new level now. */ 2937 of BPA to the new level now. */