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

Method fillFromPath

lib/valueflow.cpp:4610–4623  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

4608 }
4609
4610 static void fillFromPath(ProgramMemory& pm, const Token* top, MathLib::bigint path, const Settings& settings)
4611 {
4612 if (path < 1)
4613 return;
4614 visitAstNodes(top, [&](const Token* tok) {
4615 const ValueFlow::Value* v = ValueFlow::findValue(tok->values(), settings, [&](const ValueFlow::Value& v) {
4616 return v.path == path && isNonConditionalPossibleIntValue(v);
4617 });
4618 if (v == nullptr)
4619 return ChildrenToVisit::op1_and_op2;
4620 pm.setValue(tok, *v);
4621 return ChildrenToVisit::op1_and_op2;
4622 });
4623 }
4624
4625 void afterCondition(TokenList& tokenlist,
4626 const SymbolDatabase& symboldatabase,

Callers

nothing calls this directly

Calls 3

visitAstNodesFunction · 0.85
setValueMethod · 0.45

Tested by

no test coverage detected