Don't buffer overflow when trying to process source bytes with the high bit
set.
This commit is contained in:
parent
88fd7b3cdc
commit
c59eae1429
|
@ -10,7 +10,7 @@
|
||||||
At present such a class number is supposed to fit in 4 bits.
|
At present such a class number is supposed to fit in 4 bits.
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#define class(ch) ((tkclass)[(unsigned int)ch])
|
#define class(ch) ((tkclass)[(unsigned char)ch])
|
||||||
|
|
||||||
/* Being the start of a token is, fortunately, a mutual exclusive
|
/* Being the start of a token is, fortunately, a mutual exclusive
|
||||||
property, so, as there are less than 16 classes they can be
|
property, so, as there are less than 16 classes they can be
|
||||||
|
@ -37,11 +37,11 @@
|
||||||
class. This is implemented as a collection of tables to speed up
|
class. This is implemented as a collection of tables to speed up
|
||||||
the decision whether a character has a special meaning.
|
the decision whether a character has a special meaning.
|
||||||
*/
|
*/
|
||||||
#define in_idf(ch) (inidf[(unsigned int)ch])
|
#define in_idf(ch) (inidf[(unsigned char)ch])
|
||||||
#define is_oct(ch) (isoct[(unsigned int)ch])
|
#define is_oct(ch) (isoct[(unsigned char)ch])
|
||||||
#define is_dig(ch) (isdig[(unsigned int)ch])
|
#define is_dig(ch) (isdig[(unsigned char)ch])
|
||||||
#define is_hex(ch) (ishex[(unsigned int)ch])
|
#define is_hex(ch) (ishex[(unsigned char)ch])
|
||||||
#define is_wsp(ch) (iswsp[(unsigned int)ch])
|
#define is_wsp(ch) (iswsp[(unsigned char)ch])
|
||||||
|
|
||||||
extern char tkclass[];
|
extern char tkclass[];
|
||||||
extern char inidf[], isoct[], isdig[], ishex[], iswsp[];
|
extern char inidf[], isoct[], isdig[], ishex[], iswsp[];
|
||||||
|
|
Loading…
Reference in a new issue