fix one of the TODO testcases added for #3094 (Buffer access out-of-bounds in struct variable)

This commit is contained in:
Robert Reif 2011-09-08 22:44:25 -04:00
parent 65b1a4df19
commit 812a17f294
2 changed files with 3 additions and 3 deletions

View File

@ -1579,8 +1579,8 @@ void CheckBufferOverrun::checkStructVariable()
if (Token::Match(tok3->next(), "%var% ;"))
varname[0] = tok3->strAt(1);
// Declare pointer: Fred *fred1
else if (Token::Match(tok3->next(), "* %var% [,);=]"))
// Declare pointer or reference: Fred *fred1
else if (Token::Match(tok3->next(), "*|& %var% [,);=]"))
varname[0] = tok3->strAt(2);
else

View File

@ -1769,7 +1769,7 @@ private:
"{\n"
" strcpy( abc.str, \"abcdef\" );\n"
"}\n");
TODO_ASSERT_EQUALS("[test.cpp:8]: (error) Buffer access out-of-bounds: abc.str\n", "", errout.str());
ASSERT_EQUALS("[test.cpp:8]: (error) Buffer access out-of-bounds: abc.str\n", errout.str());
check("static void f()\n"
"{\n"