Coverity CID 1270450: Removed redundant conditions
This commit is contained in:
parent
6363c1359d
commit
b1e9d9b86f
|
@ -1498,16 +1498,13 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const Variable& var
|
||||||
Token::Match(tok->next(), "= %name% (") &&
|
Token::Match(tok->next(), "= %name% (") &&
|
||||||
Token::simpleMatch(tok->linkAt(3), ") ;") &&
|
Token::simpleMatch(tok->linkAt(3), ") ;") &&
|
||||||
_settings->library.returnuninitdata.count(tok->strAt(2)) > 0U) {
|
_settings->library.returnuninitdata.count(tok->strAt(2)) > 0U) {
|
||||||
if (alloc)
|
*alloc = NO_CTOR_CALL;
|
||||||
*alloc = NO_CTOR_CALL;
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
if (var.isPointer() && (var.typeStartToken()->isStandardType() || (var.type() && var.type()->needInitialization == Type::True)) && Token::simpleMatch(tok->next(), "= new")) {
|
if (var.isPointer() && (var.typeStartToken()->isStandardType() || (var.type() && var.type()->needInitialization == Type::True)) && Token::simpleMatch(tok->next(), "= new")) {
|
||||||
if (alloc) {
|
*alloc = CTOR_CALL;
|
||||||
*alloc = CTOR_CALL;
|
if (var.typeScope() && var.typeScope()->numConstructors > 0)
|
||||||
if (var.typeScope() && var.typeScope()->numConstructors > 0)
|
return true;
|
||||||
return true;
|
|
||||||
}
|
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue