From: Eli Zaretskii Date: Thu, 8 Apr 2010 17:35:10 +0000 (+0300) Subject: Fix crash due to incorrect resolution of type of NSM characters (bug#5858). X-Git-Tag: emacs-pretest-24.0.90~104^2~275^2~438^2~563 X-Git-Url: https://code.delx.au/gnu-emacs/commitdiff_plain/5930fe974d03470d08d0a265bc39b8139c51a198?hp=99852628a828979c55c96d7def6c5a21f2b32af5 Fix crash due to incorrect resolution of type of NSM characters (bug#5858). bidi.c (bidi_resolve_weak): Use prev.type_after_w1, instead of prev.orig_type, for resolving type of NSM. --- diff --git a/src/ChangeLog b/src/ChangeLog index 51ed028b9d..ba7687d784 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2010-04-08 Eli Zaretskii + + * bidi.c (bidi_resolve_weak): Use prev.type_after_w1, instead of + prev.orig_type, for resolving type of NSM. (Bug#5858) + 2010-04-08 Jan Djärv * xsettings.c (current_font, SYSTEM_FONT, XSETTINGS_FONT_NAME): New. diff --git a/src/bidi.c b/src/bidi.c index 7da8cd4a88..0c8a318251 100644 --- a/src/bidi.c +++ b/src/bidi.c @@ -1347,12 +1347,14 @@ bidi_resolve_weak (struct bidi_it *bidi_it) if (type == WEAK_NSM) /* W1 */ { /* Note that we don't need to consider the case where the - prev character has its type overridden by an RLO or LRO: - such characters are outside the current level run, and - thus not relevant to this NSM. Thus, NSM gets the - orig_type of the previous character. */ + prev character has its type overridden by an RLO or LRO, + because then either the type of this NSM would have been + also overridden, or the previous character is outside the + current level run, and thus not relevant to this NSM. + This is why NSM gets the type_after_w1 of the previous + character. */ if (bidi_it->prev.type != UNKNOWN_BT) - type = bidi_it->prev.orig_type; + type = bidi_it->prev.type_after_w1; else if (bidi_it->sor == R2L) type = STRONG_R; else if (bidi_it->sor == L2R)