Make sure a 64-bit char is never passed to CHAR_STRING.
authorPaul Eggert <eggert@cs.ucla.edu>
Mon, 13 Jun 2011 00:36:03 +0000 (17:36 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Mon, 13 Jun 2011 00:36:03 +0000 (17:36 -0700)
commit13bdea59234b227bf8499a64352da3e5fd9e8c7b
treededdcce496ffa4fdb6d5ffd45ec8c2c7c5c49d0c
parentd37ca62316e7526da7d75cc44c7a4cd8a6281bb5
Make sure a 64-bit char is never passed to CHAR_STRING.

Otherwise, CHAR_STRING would do the wrong thing on a 64-bit platform,
by silently ignoring the top 32 bits, allowing some values
that were far too large to be valid characters.
* character.h: Include <verify.h>.
(CHAR_STRING, CHAR_STRING_ADVANCE): Verify that the character
arguments are no wider than unsigned, as a compile-time check
to prevent future regressions in this area.
* data.c (Faset):
* editfns.c (Fchar_to_string, general_insert_function, Finsert_char):
(Fsubst_char_in_region):
* fns.c (concat):
* xdisp.c (decode_mode_spec_coding):
Adjust to CHAR_STRING's new requirement.
* editfns.c (Finsert_char, Fsubst_char_in_region):
* fns.c (concat): Check that character args are actually
characters.  Without this test, these functions did the wrong
thing with wildly out-of-range values on 64-bit hosts.
src/ChangeLog
src/character.h
src/data.c
src/editfns.c
src/fns.c
src/xdisp.c