ValueFlow: Removed wrong bailout

This commit is contained in:
Daniel Marjamäki 2014-03-21 08:33:45 +01:00
parent 30006cf06f
commit fc014f055f
2 changed files with 2 additions and 14 deletions

View File

@ -279,13 +279,8 @@ static void valueFlowBeforeCondition(TokenList *tokenlist, ErrorLogger *errorLog
continue;
if (Token::Match(tok2->previous(), "for|while (")) {
const Token *start = tok2->link()->next();
const Token *end = start->link();
if (tok2->astOperand2()->str() == ";" &&
tok2->astOperand2()->astOperand2() &&
tok2->astOperand2()->astOperand2()->str() == ";")
start = tok2->astOperand2()->astOperand2();
const Token * const start = tok2->link()->next();
const Token * const end = start->link();
if (Token::findmatch(start,"++|-- %varid%",end,varid) ||
Token::findmatch(start,"%varid% ++|--|=",end,varid)) {

View File

@ -333,13 +333,6 @@ private:
" }\n"
"}";
ASSERT_EQUALS(false, testValueOfX(code, 2U, 0));
code = "void f(unsigned int x) {\n"
" for (int a = 1000 / x;\n"
" x > 0;\n"
" x--) {}\n"
"}";
ASSERT_EQUALS(false, testValueOfX(code, 2U, 0));
}
void valueFlowBeforeConditionTernaryOp() { // bailout: ?: