emacs-diffs
[Top][All Lists]
Advanced

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

[Emacs-diffs] /srv/bzr/emacs/trunk r108391: * bidi.c (bidi_mirror_char):


From: Paul Eggert
Subject: [Emacs-diffs] /srv/bzr/emacs/trunk r108391: * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
Date: Sun, 27 May 2012 00:32:46 -0700
User-agent: Bazaar (2.5.0)

------------------------------------------------------------
revno: 108391
committer: Paul Eggert <address@hidden>
branch nick: trunk
timestamp: Sun 2012-05-27 00:32:46 -0700
message:
  * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
  
  before checking whether it's out of range.  Put the check inside
  eassert.  See
  <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
modified:
  src/ChangeLog
  src/bidi.c
=== modified file 'src/ChangeLog'
--- a/src/ChangeLog     2012-05-27 01:06:44 +0000
+++ b/src/ChangeLog     2012-05-27 07:32:46 +0000
@@ -1,3 +1,10 @@
+2012-05-27  Paul Eggert  <address@hidden>
+
+       * bidi.c (bidi_mirror_char): Don't possibly truncate the integer
+       before checking whether it's out of range.  Put the check inside
+       eassert.  See
+       <http://lists.gnu.org/archive/html/emacs-devel/2012-05/msg00485.html>.
+
 2012-05-27  Ken Brown  <address@hidden>
 
        * callproc.c (Fcall_process): Restore a line that was accidentally

=== modified file 'src/bidi.c'
--- a/src/bidi.c        2012-05-26 07:03:39 +0000
+++ b/src/bidi.c        2012-05-27 07:32:46 +0000
@@ -204,12 +204,8 @@
   val = CHAR_TABLE_REF (bidi_mirror_table, c);
   if (INTEGERP (val))
     {
-      int v = XINT (val);
-
-      if (v < 0 || v > MAX_CHAR)
-       abort ();
-
-      return v;
+      eassert (CHAR_VALID_P (XINT (val)));
+      return XINT (val);
     }
 
   return c;


reply via email to

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