Merge pull request #546 from Dmitry-Me/properChainConditions

Proper if-else-if chain for mutually exclusive conditions
This commit is contained in:
amai2012 2015-03-14 17:38:06 +01:00
commit 53e2d425d1
1 changed files with 1 additions and 1 deletions

View File

@ -1302,7 +1302,7 @@ bool CheckUninitVar::checkScopeForVariable(const Token *tok, const Variable& var
for (const Token *tok2 = tok; tok2 && tok2 != tok->link(); tok2 = tok2->next()) {
if (Token::Match(tok2, "[;{}.] %name% = - %name% ;"))
varValueIf[tok2->next()->varId()] = NOT_ZERO;
if (Token::Match(tok2, "[;{}.] %name% = %num% ;"))
else if (Token::Match(tok2, "[;{}.] %name% = %num% ;"))
varValueIf[tok2->next()->varId()] = (int)MathLib::toLongNumber(tok2->strAt(3));
}
}