diff --git a/lib/checkother.cpp b/lib/checkother.cpp index 0cab94dbf..c1a0f30b7 100644 --- a/lib/checkother.cpp +++ b/lib/checkother.cpp @@ -3395,6 +3395,22 @@ private: // it is possible that the variable is initialized here if (Token::Match(tok2->previous(), "[(,] %var% [,)]")) bailouts.insert(tok2->varId()); + + // array initialization.. + if (Token::Match(tok2->previous(), "[,(] %var% +")) + { + // if var is array, bailout + for (std::list::const_iterator it = checks.begin(); it != checks.end(); ++it) + { + if ((*it)->varId == tok2->varId()) + { + const CheckUninitVar *c = dynamic_cast(*it); + if (c && c->array) + bailouts.insert(tok2->varId()); + break; + } + } + } } } diff --git a/test/testother.cpp b/test/testother.cpp index 10b312e89..b3bd301f5 100644 --- a/test/testother.cpp +++ b/test/testother.cpp @@ -1930,7 +1930,7 @@ private: " y + 1 );\n" " s = y[0]*y[1];\n" "}\n"); - TODO_ASSERT_EQUALS("", errout.str()); + ASSERT_EQUALS("", errout.str()); } // alloc..