Fixed #3060 (False positive: Uninitialized variable: fresh)
This commit is contained in:
parent
e782d98241
commit
85d83d86ac
|
@ -596,8 +596,10 @@ private:
|
|||
return tok.tokAt(3);
|
||||
}
|
||||
|
||||
else if (Token::simpleMatch(tok.previous(), ">>") || Token::simpleMatch(tok.next(), "="))
|
||||
else if (Token::Match(tok.previous(), "<<|>>") || Token::simpleMatch(tok.next(), "="))
|
||||
{
|
||||
// TODO: Don't bail out for "<<" and ">>" if these are
|
||||
// just computations
|
||||
ExecutionPath::bailOutVar(checks, tok.varId());
|
||||
return &tok;
|
||||
}
|
||||
|
|
|
@ -322,6 +322,13 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("int a(FArchive &arc) {\n" // #3060 (initialization through operator<<)
|
||||
" int *p;\n"
|
||||
" arc << p;\n"
|
||||
" return *p;\n"
|
||||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
checkUninitVar("int a()\n"
|
||||
"{\n"
|
||||
" int ret;\n"
|
||||
|
|
Loading…
Reference in New Issue