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:
zik.saleeba 2010-06-02 19:31:51 +00:00
parent f5dc81754c
commit 54ad31d6d3

2
lex.c
View file

@ -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;