CheckCondition: Fix FP found in daca results (ace)

This commit is contained in:
Daniel Marjamäki 2017-09-05 09:33:35 +02:00
parent d7b91a9e92
commit c1000998f0
2 changed files with 10 additions and 1 deletions

View File

@ -503,7 +503,7 @@ void CheckCondition::multiCondition2()
}
} else if (!nonlocal && cond->isName()) {
// varid is 0. this is possibly a nonlocal variable..
nonlocal = Token::Match(cond->astParent(), "%cop%|(|[");
nonlocal = Token::Match(cond->astParent(), "%cop%|(|[") || (_tokenizer->isCPP() && cond->str() == "this");
} else {
tokens.push(cond->astOperand1());
tokens.push(cond->astOperand2());

View File

@ -1513,6 +1513,15 @@ private:
" }\n"
"}");
ASSERT_EQUALS("", errout.str());
check("void Fred::f() {\n" // daca: ace
" if (this->next_ == map_man_->table_) {\n"
" this->next_ = n;\n"
" if (this->next_ != map_man_->table_) {}\n"
" }\n"
"}");
ASSERT_EQUALS("", errout.str());
}
void oppositeInnerConditionClass() {