Fix #684 (Tokenizer: (65536*72/100) incorrectly simplified to zero)

http://sourceforge.net/apps/trac/cppcheck/ticket/684
This commit is contained in:
Reijo Tomperi 2009-09-15 23:38:54 +03:00
parent 5efedf85d6
commit 55fc473a00
2 changed files with 2 additions and 1 deletions

View File

@ -3164,7 +3164,7 @@ bool Tokenizer::simplifyCalculations()
}
// (1-2)
if (Token::Match(tok, "[[,(=<>+-*] %num% [+-*/] %num% [],);=<>+-*]"))
if (Token::Match(tok, "[[,(=<>+-*] %num% [+-*/] %num% [],);=<>+-*/]"))
{
tok = tok->next();

View File

@ -1420,6 +1420,7 @@ private:
ASSERT_EQUALS("x = 1 + 2 * y ;", tok("x=1+2*y;"));
ASSERT_EQUALS("x = 7 ;", tok("x=1+2*3;"));
ASSERT_EQUALS("x = 47185 ;", tok("x=(65536*72/100);"));
}