- Fixed: ACC's EvalFixedConstant() could overflow when adding the fractional part to

the integral part of the number.

SVN r1611 (trunk)
This commit is contained in:
Randy Heit 2009-05-26 17:36:40 +00:00
parent 9392539534
commit 4030849b1e

View file

@ -956,8 +956,8 @@ static void ProcessNumberToken(void)
static void EvalFixedConstant(int whole)
{
int frac;
int divisor;
double frac;
double divisor;
frac = 0;
divisor = 1;
@ -967,7 +967,7 @@ static void EvalFixedConstant(int whole)
divisor *= 10;
NextChr();
}
tk_Number = (whole<<16)+((frac<<16)/divisor);
tk_Number = (whole<<16)+(int)(65536.0*frac/divisor);
tk_Token = TK_NUMBER;
}