Skip to content

Commit ae9feb0

Browse files
committed
combineValueProperties
1 parent 88c7fda commit ae9feb0

File tree

1 file changed

+1
-18
lines changed

1 file changed

+1
-18
lines changed

lib/valueflowfast.cpp

Lines changed: 1 addition & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -311,23 +311,6 @@ static ValueFlow::Value castValue(ValueFlow::Value value, const ValueType::Sign
311311
return value;
312312
}
313313

314-
static void combineValueProperties(const ValueFlow::Value &value1, const ValueFlow::Value &value2, ValueFlow::Value *result)
315-
{
316-
if (value1.isKnown() && value2.isKnown())
317-
result->setKnown();
318-
else if (value1.isImpossible() || value2.isImpossible())
319-
result->setImpossible();
320-
else if (value1.isInconclusive() || value2.isInconclusive())
321-
result->setInconclusive();
322-
else
323-
result->setPossible();
324-
result->condition = value1.condition ? value1.condition : value2.condition;
325-
result->varId = (value1.varId != 0U) ? value1.varId : value2.varId;
326-
result->varvalue = (result->varId == value1.varId) ? value1.varvalue : value2.varvalue;
327-
result->errorPath = (value1.errorPath.empty() ? value2 : value1).errorPath;
328-
result->safe = value1.safe || value2.safe;
329-
}
330-
331314
static const Token *getCastTypeStartToken(const Token *parent, const Settings& settings)
332315
{
333316
// TODO: This might be a generic utility function?
@@ -4369,7 +4352,7 @@ static bool evaluate(const Token *expr, const std::vector<std::list<ValueFlow::V
43694352
result->emplace_back(ValueFlow::Value(val1.intvalue >> val2.intvalue));
43704353
else
43714354
return false;
4372-
combineValueProperties(val1, val2, &result->back());
4355+
ValueFlow::combineValueProperties(val1, val2, result->back());
43734356
}
43744357
}
43754358
return !result->empty();

0 commit comments

Comments
 (0)