Tokenizer::simplifyKnownVariables: Fixed TODO test cases in TestBufferOverrun
This commit is contained in:
parent
47e9fcb5a8
commit
586f4992d8
|
@ -6095,7 +6095,7 @@ bool Tokenizer::simplifyKnownVariables()
|
|||
}
|
||||
|
||||
// array usage
|
||||
if (Token::Match(tok3, "( %varid% [", varid))
|
||||
if (Token::Match(tok3, "[(,] %varid% [+-*/[]", varid))
|
||||
{
|
||||
tok3 = tok3->next();
|
||||
tok3->str(value);
|
||||
|
|
|
@ -1359,8 +1359,7 @@ private:
|
|||
"char str[i];\n"
|
||||
"fread(str,sizeof(char),i+1,fd);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str()); // catch changes
|
||||
TODO_ASSERT_EQUALS("[test.cpp:5]: (error) Buffer access out-of-bounds\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:5]: (error) Buffer access out-of-bounds: str\n", errout.str());
|
||||
|
||||
check("void f(FILE* fd)\n"
|
||||
"{\n"
|
||||
|
@ -1383,8 +1382,7 @@ private:
|
|||
"char str[i];\n"
|
||||
"fwrite(str,sizeof(char),i+1,fd);\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str()); // catch changes
|
||||
TODO_ASSERT_EQUALS("[test.cpp:5]: (error) Buffer access out-of-bounds\n", errout.str());
|
||||
ASSERT_EQUALS("[test.cpp:5]: (error) Buffer access out-of-bounds: str\n", errout.str());
|
||||
|
||||
check("void f(FILE* fd)\n"
|
||||
"{\n"
|
||||
|
|
Loading…
Reference in New Issue