diff --git a/lib/valueflow.cpp b/lib/valueflow.cpp index 6daa4ad75..3778bbff1 100644 --- a/lib/valueflow.cpp +++ b/lib/valueflow.cpp @@ -1680,7 +1680,7 @@ static bool valueFlowForward(Token * const startToken, std::list::const_iterator it; for (it = values.begin(); it != values.end(); ++it) setTokenValue(tok3, *it, settings); - } else if (Token::Match(tok3, "++|--|?|:|;")) + } else if (Token::Match(tok3, "++|--|?|:|;|,")) break; // Skip sizeof etc else if (Token::Match(tok3, "sizeof|typeof|typeid (")) diff --git a/test/testvalueflow.cpp b/test/testvalueflow.cpp index aaacfcb56..8b2b1fc1c 100644 --- a/test/testvalueflow.cpp +++ b/test/testvalueflow.cpp @@ -2530,6 +2530,13 @@ private: " x = dostuff(sizeof(*x)*y);\n" "}"; ASSERT_EQUALS(0U, tokenValues(code, "x )").size()); + + // #8036 + code = "void foo() {\n" + " int x;\n" + " f(x=3), return x+3;\n" + "}"; + ASSERT_EQUALS(0U, tokenValues(code, "x +").size()); } };