Fixed #3414 (false positive: (error) Uninitialized variable: SOutput)
This commit is contained in:
parent
005b1cff61
commit
6221145be8
|
@ -1123,8 +1123,8 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const unsigned int
|
|||
}
|
||||
}
|
||||
|
||||
// TODO: handle loops etc
|
||||
if (Token::simpleMatch(tok, ") {")) {
|
||||
// TODO: handle loops, try, etc
|
||||
if (Token::simpleMatch(tok, ") {") || Token::Match(tok, "%var% {")) {
|
||||
ret = true;
|
||||
return false;
|
||||
}
|
||||
|
|
|
@ -1784,6 +1784,13 @@ private:
|
|||
"}\n");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// try
|
||||
checkUninitVar2("void f() {\n"
|
||||
" int i, *p = &i;\n"
|
||||
" try { }\n"
|
||||
"}");
|
||||
ASSERT_EQUALS("", errout.str());
|
||||
|
||||
// exit
|
||||
checkUninitVar2("void f() {\n"
|
||||
" int x;\n"
|
||||
|
|
Loading…
Reference in New Issue