Skip to content

Commit

Permalink
Fix #684 (Tokenizer: (65536*72/100) incorrectly simplified to zero)
Browse files Browse the repository at this point in the history
  • Loading branch information
aggro80 committed Sep 15, 2009
1 parent 5efedf8 commit 55fc473
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/tokenize.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3164,7 +3164,7 @@ bool Tokenizer::simplifyCalculations()
}

// (1-2)
if (Token::Match(tok, "[[,(=<>+-*] %num% [+-*/] %num% [],);=<>+-*]"))
if (Token::Match(tok, "[[,(=<>+-*] %num% [+-*/] %num% [],);=<>+-*/]"))
{
tok = tok->next();

Expand Down
1 change: 1 addition & 0 deletions test/testsimplifytokens.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1420,6 +1420,7 @@ class TestSimplifyTokens : public TestFixture

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);"));
}


Expand Down

0 comments on commit 55fc473

Please sign in to comment.