Ben Wing <ben(a)666.com> writes:
Veto. Instead, fix buffer_insert_1() and Finsert_markers() -- they
need a call to
CHECK_CHAR_COERCE_INT() inserted.
Thanks. I found bug in Finsert_char and others. It calls
CHECK_CHAR_COERCE_INT but it is not sufficient. Its
definition is
#define CHECK_CHAR_COERCE_INT(x) do { \
if (CHARP (x)) \
; \
else if (CHAR_INTP (x)) \
x = make_char (XINT (x)); \
else \
x = wrong_type_argument (Qcharacterp, x); \
} while (0)
so it accepts integer as an argument.
(insert-char ?8000) is OK while (insert-char 8000) makes
XEmacs crash. It should reject integer argument, right?
Other function which call CHECK_CHAR_COERCE_INT is also
broken. For example, you can crash XEmacs with
(make-string 1 8000).
How should I fix this? Should I change CHECK_CHAR_COERCE_INT
not to accept integer or make new macro CHECK_CHAR_COERCE
which doesn't accept integer?
BTW, I couldn't find Finsert_markers. I found
Finsert_before_markers but it just calls buffer_insert_1
when argument is char or int. So it's OK when we fix
buffer_insert_1.
--
Yoshiki Hayashi