emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] /srv/bzr/emacs/emacs-24 r111247: Fix rare aborts in bidi.c


From: Eli Zaretskii
Subject: [Emacs-diffs] /srv/bzr/emacs/emacs-24 r111247: Fix rare aborts in bidi.c.
Date: Mon, 11 Feb 2013 19:27:48 +0200
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 111247
committer: Eli Zaretskii <address@hidden>
branch nick: emacs-24
timestamp: Mon 2013-02-11 19:27:48 +0200
message:
  Fix rare aborts in bidi.c.
  
   src/bidi.c (bidi_resolve_neutral): After finding the next
   non-neutral character, accept NEUTRAL_ON type as well, because
   directional control characters, such as LRE and RLE, have their
   type converted to that by bidi_resolve_weak.  This avoids aborts
   when LRE/RLE follows a run of neutrals.
   (bidi_move_to_visually_next): Assert that return value of
   bidi_peek_at_next_level is non-negative.  Negative values will
   cause an infloop.
modified:
  src/ChangeLog
  src/bidi.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2013-02-06 04:37:28 +0000
+++ b/src/ChangeLog     2013-02-11 17:27:48 +0000
@@ -1,3 +1,14 @@
+2013-02-11  Eli Zaretskii  <address@hidden>
+
+       * bidi.c (bidi_resolve_neutral): After finding the next
+       non-neutral character, accept NEUTRAL_ON type as well, because
+       directional control characters, such as LRE and RLE, have their
+       type converted to that by bidi_resolve_weak.  This avoids aborts
+       when LRE/RLE follows a run of neutrals.
+       (bidi_move_to_visually_next): Assert that return value of
+       bidi_peek_at_next_level is non-negative.  Negative values will
+       cause an infloop.
+
 2013-02-05  Daniel Colascione  <address@hidden>
 
        * emacs.c: Use execvp, not execv, when DAEMON_MUST_EXEC, so that

=== modified file 'src/bidi.c'
--- a/src/bidi.c        2013-01-01 09:11:05 +0000
+++ b/src/bidi.c        2013-02-11 17:27:48 +0000
@@ -1973,6 +1973,7 @@
                next_type = STRONG_R;
                break;
              case WEAK_BN:
+             case NEUTRAL_ON:  /* W6/Retaining */
                if (!bidi_explicit_dir_char (bidi_it->ch))
                  emacs_abort (); /* can't happen: BNs are skipped */
                /* FALLTHROUGH */
@@ -2391,6 +2392,10 @@
       next_level = bidi_peek_at_next_level (bidi_it);
       while (next_level != expected_next_level)
        {
+         /* If next_level is -1, it means we have an unresolved level
+            in the cache, which at this point should not happen.  If
+            it does, we will infloop.  */
+         eassert (next_level >= 0);
          expected_next_level += incr;
          level_to_search += incr;
          bidi_find_other_level_edge (bidi_it, level_to_search, !ascending);


reply via email to

[Prev in Thread] Current Thread [Next in Thread]