Commit 8fd02eb7 authored by Paul Eggert's avatar Paul Eggert

* 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.
parent f8c86b69
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.
......
......@@ -524,15 +524,15 @@ a cons of character codes (for characters in the range), or a character code. *
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. */
}
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment