Uninitialized variables: Experimental checking for passing const pointer to partially initialized struct to function. Ticket: #5586
This commit is contained in:
parent
8de4246713
commit
22a5881bee
|
@ -1882,6 +1882,12 @@ bool CheckUninitVar::isMemberVariableUsage(const Token *tok, bool isPointer, boo
|
||||||
else if (!isPointer && Token::Match(tok->previous(), "[(,] %var% [,)]") && isVariableUsage(tok, isPointer, alloc, _tokenizer->isCPP()))
|
else if (!isPointer && Token::Match(tok->previous(), "[(,] %var% [,)]") && isVariableUsage(tok, isPointer, alloc, _tokenizer->isCPP()))
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
|
else if (_settings->experimental &&
|
||||||
|
!isPointer &&
|
||||||
|
Token::Match(tok->tokAt(-2), "[(,] & %var% [,)]") &&
|
||||||
|
isVariableUsage(tok, isPointer, alloc, _tokenizer->isCPP()))
|
||||||
|
return true;
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue