cleanup redundant variable inconclusive

This commit is contained in:
Daniel Marjamäki 2014-01-18 19:51:57 +01:00
parent 77f3f6c21a
commit 2d0a68cac2
1 changed files with 4 additions and 6 deletions

View File

@ -269,7 +269,6 @@ static void valueFlowBeforeCondition(TokenList *tokenlist, ErrorLogger *errorLog
} }
} }
bool inconclusive = false;
for (Token *tok2 = tok->previous(); ; tok2 = tok2->previous()) { for (Token *tok2 = tok->previous(); ; tok2 = tok2->previous()) {
if (!tok2) { if (!tok2) {
if (settings->debugwarnings) { if (settings->debugwarnings) {
@ -308,15 +307,14 @@ static void valueFlowBeforeCondition(TokenList *tokenlist, ErrorLogger *errorLog
} }
// assigned by subfunction? // assigned by subfunction?
bool inconclusive2 = false; bool inconclusive = false;
if (bailoutFunctionPar(tok2,val2.condition ? val2 : val, settings, &inconclusive2)) { if (bailoutFunctionPar(tok2,val2.condition ? val2 : val, settings, &inconclusive)) {
if (settings->debugwarnings) if (settings->debugwarnings)
bailout(tokenlist, errorLogger, tok2, "possible assignment of " + tok2->str() + " by subfunction"); bailout(tokenlist, errorLogger, tok2, "possible assignment of " + tok2->str() + " by subfunction");
break; break;
} }
inconclusive |= inconclusive2; val.inconclusive |= inconclusive;
val.inconclusive |= inconclusive2; val2.inconclusive |= inconclusive;
val2.inconclusive |= inconclusive2;
// skip if variable is conditionally used in ?: expression // skip if variable is conditionally used in ?: expression
if (const Token *parent = skipValueInConditionalExpression(tok2)) { if (const Token *parent = skipValueInConditionalExpression(tok2)) {