diff options
author | Eli Zaretskii <eliz@gnu.org> | 2016-07-16 16:42:18 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2016-07-16 16:42:18 +0300 |
commit | 59fa4c39f4141a0f2cb3c41e180ed812be577b27 (patch) | |
tree | 54ddb3e0b5edff9bfee8b6f441f44e4a0d6c4d69 /src/bidi.c | |
parent | 916abe91fd250fc5ed27ec0be7d57421e7908111 (diff) | |
download | emacs-59fa4c39f4141a0f2cb3c41e180ed812be577b27.tar.gz |
Avoid assertion violations in nhexl-mode
* src/bidi.c (bidi_resolve_neutral): Convert an assertion to real
code executed in all builds. (Bug#24001)
Diffstat (limited to 'src/bidi.c')
-rw-r--r-- | src/bidi.c | 14 |
1 files changed, 6 insertions, 8 deletions
diff --git a/src/bidi.c b/src/bidi.c index 573e513469d..c2208cd12c2 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -2977,15 +2977,13 @@ bidi_resolve_neutral (struct bidi_it *bidi_it) /* N1-N2/Retaining */ || type == WEAK_BN) { - if (bidi_it->next_for_neutral.type != UNKNOWN_BT) + if (bidi_it->next_for_neutral.type != UNKNOWN_BT + && (bidi_it->next_for_neutral.charpos > bidi_it->charpos + /* PDI defines an eos, so it's OK for it to serve as its + own next_for_neutral. */ + || (bidi_it->next_for_neutral.charpos == bidi_it->charpos + && bidi_it->type == PDI))) { - /* Make sure the data for resolving neutrals we are - about to use is valid. */ - eassert (bidi_it->next_for_neutral.charpos > bidi_it->charpos - /* PDI defines an eos, so it's OK for it to - serve as its own next_for_neutral. */ - || (bidi_it->next_for_neutral.charpos == bidi_it->charpos - && bidi_it->type == PDI)); type = bidi_resolve_neutral_1 (bidi_it->prev_for_neutral.type, bidi_it->next_for_neutral.type, current_level); |