Fixed #1301 (False positive: Data is allocated but not initialized)
This commit is contained in:
parent
aab05524e5
commit
43c8fe895c
|
@ -1910,6 +1910,8 @@ private:
|
|||
{
|
||||
if (!Token::Match(tok.previous(), "[;{}] %var% . %var% ="))
|
||||
use_pointer(foundError, checks, &tok);
|
||||
else
|
||||
bailOutVar(checks, tok.varId());
|
||||
return &tok;
|
||||
}
|
||||
|
||||
|
|
|
@ -1606,6 +1606,14 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void foo()\n"
|
||||
"{\n"
|
||||
" ABC *abc = malloc(100);\n"
|
||||
" abc->a = 123;\n"
|
||||
" abc->a += 123;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("void foo()\n"
|
||||
"{\n"
|
||||
" ABC *abc = malloc(100);\n"
|
||||
|
|
Loading…
Reference in New Issue