mirror of
https://github.com/ZDoom/acc.git
synced 2025-02-11 22:37:54 +00:00
- 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:
parent
9392539534
commit
4030849b1e
1 changed files with 3 additions and 3 deletions
6
token.c
6
token.c
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue