We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
ConditionHandler::traverseCondition()
1 parent 39f3a75 commit 47af2cfCopy full SHA for 47af2cf
lib/valueflow.cpp
@@ -4602,11 +4602,15 @@ struct ConditionHandler {
4602
if (Token::Match(tok, ":|;|,"))
4603
continue;
4604
4605
+ std::vector<Condition> conditions = parse(tok, settings);
4606
+ if (conditions.empty())
4607
+ continue;
4608
+
4609
const Token* top = tok->astTop();
4610
4611
if (!Token::Match(top->previous(), "if|while|for (") && !Token::Match(tok->astParent(), "&&|%oror%|?|!"))
4612
- for (const Condition& cond : parse(tok, settings)) {
4613
+ for (const Condition& cond : conditions) {
4614
if (!cond.vartok)
4615
4616
if (cond.vartok->exprId() == 0)
0 commit comments