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

Method getValue

lib/token.cpp:2571–2579  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2569}
2570
2571const ValueFlow::Value* Token::getValue(const MathLib::bigint val) const
2572{
2573 if (!mImpl->mValues)
2574 return nullptr;
2575 const auto it = std::find_if(mImpl->mValues->begin(), mImpl->mValues->end(), [=](const ValueFlow::Value& value) {
2576 return value.isIntValue() && !value.isImpossible() && value.intvalue == val;
2577 });
2578 return it == mImpl->mValues->end() ? nullptr : &*it;
2579}
2580
2581template<class Compare>
2582static const ValueFlow::Value* getCompareValue(const std::list<ValueFlow::Value>& values,

Callers 11

arithmeticMethod · 0.45
checkIfForWhileHeadMethod · 0.45
checkZeroDivisionMethod · 0.45
checkModuloOfOneMethod · 0.45
invalidFunctionUsageMethod · 0.45
addByOneFunction · 0.45
skipUnreachableIfBranchFunction · 0.45

Calls 3

isImpossibleMethod · 0.80
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected