Fixed #1154 (false positive: Data is allocated but not initialized)
This commit is contained in:
parent
738987a686
commit
1c0f3ee179
|
@ -1664,6 +1664,7 @@ private:
|
||||||
|
|
||||||
if (Token::simpleMatch(tok.next(), "."))
|
if (Token::simpleMatch(tok.next(), "."))
|
||||||
{
|
{
|
||||||
|
if (!Token::Match(tok.previous(), "[;{}] %var% . %var% ="))
|
||||||
use_pointer(foundError, checks, &tok);
|
use_pointer(foundError, checks, &tok);
|
||||||
return &tok;
|
return &tok;
|
||||||
}
|
}
|
||||||
|
|
|
@ -1342,6 +1342,13 @@ private:
|
||||||
"}\n");
|
"}\n");
|
||||||
ASSERT_EQUALS("", errout.str());
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
|
checkUninitVar("void foo()\n"
|
||||||
|
"{\n"
|
||||||
|
" ABC *abc = malloc(100);\n"
|
||||||
|
" abc->a = 123;\n"
|
||||||
|
"}\n");
|
||||||
|
ASSERT_EQUALS("", errout.str());
|
||||||
|
|
||||||
// struct..
|
// struct..
|
||||||
checkUninitVar("void f()\n"
|
checkUninitVar("void f()\n"
|
||||||
"{\n"
|
"{\n"
|
||||||
|
|
Loading…
Reference in New Issue