2011-06-13 Paul Eggert <eggert@cs.ucla.edu>
+ * chartab.c (Fchar_table_range): Use CHARACTERP to check range.
+ Otherwise, an out-of-range integer could cause undefined behavior
+ on a 64-bit host.
+
* composite.c: Use int, not EMACS_INT, for characters.
(fill_gstring_body, composition_compute_stop_pos): Use int, not
EMACS_INT, for values that are known to be in character range.
if (EQ (range, Qnil))
val = XCHAR_TABLE (char_table)->defalt;
- else if (INTEGERP (range))
- val = CHAR_TABLE_REF (char_table, XINT (range));
+ else if (CHARACTERP (range))
+ val = CHAR_TABLE_REF (char_table, XFASTINT (range));
else if (CONSP (range))
{
int from, to;
CHECK_CHARACTER_CAR (range);
CHECK_CHARACTER_CDR (range);
- val = char_table_ref_and_range (char_table, XINT (XCAR (range)),
+ val = char_table_ref_and_range (char_table, XFASTINT (XCAR (range)),
&from, &to);
/* Not yet implemented. */
}