Skip to content

Commit 916c809

Browse files
Update valueflow.cpp
1 parent bef5e67 commit 916c809

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎lib/valueflow.cpp‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1178,6 +1178,10 @@ static void valueFlowImpossibleValues(TokenList& tokenList, const Settings& sett
11781178
ValueFlow::Value value{0};
11791179
value.setImpossible();
11801180
setTokenValue(tok, std::move(value), settings);
1181+
} else if (tok->function()) {
1182+
ValueFlow::Value value{0};
1183+
value.setImpossible();
1184+
setTokenValue(tok, std::move(value), settings);
11811185
}
11821186
}
11831187
}
@@ -5162,7 +5166,7 @@ static void valueFlowInferCondition(TokenList& tokenlist, const Settings& settin
51625166
}
51635167
} else if (Token::Match(tok->astParent(), "?|&&|!|%oror%") ||
51645168
Token::Match(tok->astParent()->previous(), "if|while (") ||
5165-
(astIsPointer(tok) && isUsedAsBool(tok, settings))) {
5169+
((astIsPointer(tok) || tok->function()) && isUsedAsBool(tok, settings))) {
51665170
std::vector<ValueFlow::Value> result = infer(makeIntegralInferModel(), "!=", tok->values(), 0);
51675171
if (result.size() != 1)
51685172
continue;

0 commit comments

Comments
 (0)