ValueFlow: Clarify warnings when argument min/max values are used
This commit is contained in:
parent
a997a30824
commit
f0aeb845e5
|
@ -5439,10 +5439,14 @@ static void valueFlowSafeFunctions(TokenList *tokenlist, SymbolDatabase *symbold
|
||||||
}
|
}
|
||||||
|
|
||||||
std::list<ValueFlow::Value> argValues;
|
std::list<ValueFlow::Value> argValues;
|
||||||
if (isLow)
|
if (isLow) {
|
||||||
argValues.emplace_back(low);
|
argValues.emplace_back(low);
|
||||||
if (isHigh)
|
argValues.back().errorPath.emplace_back(arg.nameToken(), "Assuming argument has value " + MathLib::toString(low));
|
||||||
|
}
|
||||||
|
if (isHigh) {
|
||||||
argValues.emplace_back(high);
|
argValues.emplace_back(high);
|
||||||
|
argValues.back().errorPath.emplace_back(arg.nameToken(), "Assuming argument has value " + MathLib::toString(high));
|
||||||
|
}
|
||||||
|
|
||||||
if (!argValues.empty())
|
if (!argValues.empty())
|
||||||
valueFlowForward(const_cast<Token *>(functionScope->bodyStart->next()),
|
valueFlowForward(const_cast<Token *>(functionScope->bodyStart->next()),
|
||||||
|
|
Loading…
Reference in New Issue