Uninitialized variables: Fix false positive if variable is used after return (goto). Ticket: #3369
This commit is contained in:
parent
10228881c7
commit
f797307edc
|
@ -1131,6 +1131,8 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const unsigned int
|
||||||
|
|
||||||
if (Token::Match(tok, "return|break|continue|throw"))
|
if (Token::Match(tok, "return|break|continue|throw"))
|
||||||
ret = true;
|
ret = true;
|
||||||
|
else if (ret && tok->str() == ";")
|
||||||
|
return false;
|
||||||
|
|
||||||
// variable is seen..
|
// variable is seen..
|
||||||
if (tok->varId() == varid) {
|
if (tok->varId() == varid) {
|
||||||
|
|
Loading…
Reference in New Issue