aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/ChangeLog4
-rw-r--r--src/bidi.c12
2 files changed, 15 insertions, 1 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index 264bf1e578c..dabee858320 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
12012-05-27 Eli Zaretskii <eliz@gnu.org>
2
3 * bidi.c (bidi_mirror_char): Fix last change.
4
12012-05-27 Andreas Schwab <schwab@linux-m68k.org> 52012-05-27 Andreas Schwab <schwab@linux-m68k.org>
2 6
3 * unexmacosx.c (copy_data_segment): Truncate after 16 characters 7 * unexmacosx.c (copy_data_segment): Truncate after 16 characters
diff --git a/src/bidi.c b/src/bidi.c
index 70274560dda..29abfb90838 100644
--- a/src/bidi.c
+++ b/src/bidi.c
@@ -204,8 +204,18 @@ bidi_mirror_char (int c)
204 val = CHAR_TABLE_REF (bidi_mirror_table, c); 204 val = CHAR_TABLE_REF (bidi_mirror_table, c);
205 if (INTEGERP (val)) 205 if (INTEGERP (val))
206 { 206 {
207 int v = XINT (val);
208
209 /* In a build with extra checks, make sure the value does not
210 overflow a 32-bit int. */
207 eassert (CHAR_VALID_P (XINT (val))); 211 eassert (CHAR_VALID_P (XINT (val)));
208 return XINT (val); 212
213 /* Minimal test we must do in optimized builds, to prevent weird
214 crashes further down the road. */
215 if (v < 0 || v > MAX_CHAR)
216 abort ();
217
218 return v;
209 } 219 }
210 220
211 return c; 221 return c;