ValueFlow: Removed wrong bailout
This commit is contained in:
parent
30006cf06f
commit
fc014f055f
|
@ -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)) {
|
||||
|
|
|
@ -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: ?:
|
||||
|
|
Loading…
Reference in New Issue