Fixed a problem with lexing very large hex constants as reported by Sen Chang in issue #78.
git-svn-id: http://picoc.googlecode.com/svn/trunk@417 21eae674-98b7-11dd-bd71-f92a316d2d60
This commit is contained in:
parent
f5dc81754c
commit
54ad31d6d3
2
lex.c
2
lex.c
|
@ -151,7 +151,7 @@ enum LexToken LexGetNumber(struct LexState *Lexer, struct Value *Value)
|
|||
for (; Lexer->Pos != Lexer->End && IS_BASE_DIGIT(*Lexer->Pos, Base); LEXER_INC(Lexer))
|
||||
Result = Result * Base + GET_BASE_DIGIT(*Lexer->Pos);
|
||||
|
||||
if (Result <= MAX_CHAR_VALUE)
|
||||
if (Result >= 0 && Result <= MAX_CHAR_VALUE)
|
||||
{
|
||||
Value->Typ = &CharType;
|
||||
Value->Val->Character = Result;
|
||||
|
|
Loading…
Reference in a new issue