quick fix for #1969 (False positive: Uninitialized variable when exit() is called before variable is used.)

This commit is contained in:
Daniel Marjamäki 2010-08-26 23:11:04 +02:00
parent 0597c50a47
commit 02088443f9
1 changed files with 7 additions and 0 deletions

View File

@ -304,6 +304,13 @@ static void checkExecutionPaths_(const Token *tok, std::list<ExecutionPath *> &c
return;
}
// might be a noreturn function..
if (Token::Match(tok->previous(), "[;{}] %var% ( ) ; }") && tok->varId() == 0)
{
ExecutionPath::bailOut(checks);
return;
}
// don't parse into "struct type { .."
if (Token::Match(tok, "struct|union|class %type% {|:"))
{