diff --git a/lib/tokenlist.cpp b/lib/tokenlist.cpp index a1900f2e5..cd55145b9 100644 --- a/lib/tokenlist.cpp +++ b/lib/tokenlist.cpp @@ -687,7 +687,7 @@ static void compileExpression(Token *&tok, std::stack &op) void TokenList::createAst() { for (Token *tok = _front; tok; tok = tok ? tok->next() : NULL) { - if (tok->str() == "return" || !tok->previous() || Token::Match(tok, "%var% %op%|(|[|.|=|::") || Token::Match(tok->previous(), "[;{}] %cop%")) { + if (tok->str() == "return" || !tok->previous() || Token::Match(tok, "%var% %op%|(|[|.|=|::") || Token::Match(tok->previous(), "[;{}] %cop%|(")) { std::stack operands; compileExpression(tok, operands); } diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index df0a49c54..e12c712ee 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -114,8 +114,8 @@ private: ASSERT_EQUALS(false, testValueOfX(code, 3U, 0)); code = "void f(int *x) {\n" - " if ((x=ret())&&\n" - " (*x==0));\n" // <- x is not 0 + " ((x=ret())&&\n" + " (*x==0));\n" // <- x is not 0 " if (x==0) {}\n" "}"; ASSERT_EQUALS(false, testValueOfX(code, 3U, 0));