MCPcopy Create free account
hub / github.com/cppcheck-opensource/cppcheck / inferCondition

Function inferCondition

lib/infer.cpp:412–422  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

410}
411
412ValueFlow::Value inferCondition(const std::string& op, const Token* varTok, MathLib::bigint val)
413{
414 if (!varTok)
415 return ValueFlow::Value{};
416 if (varTok->hasKnownIntValue())
417 return ValueFlow::Value{};
418 std::vector<ValueFlow::Value> r = infer(makeIntegralInferModel(), op, varTok->values(), val);
419 if (r.size() == 1 && r.front().isKnown())
420 return r.front();
421 return ValueFlow::Value{};
422}

Callers 3

isOutOfBoundsImplFunction · 0.85
isOutOfBoundsMethod · 0.85

Calls 6

inferFunction · 0.85
makeIntegralInferModelFunction · 0.85
isKnownMethod · 0.80
frontMethod · 0.80
hasKnownIntValueMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected