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

Function valueFlowInjectParameter

lib/valueflow.cpp:5502–5524  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

5500}
5501
5502static void valueFlowInjectParameter(const TokenList& tokenlist,
5503 ErrorLogger& errorLogger,
5504 const Settings& settings,
5505 const Scope* functionScope,
5506 const std::unordered_map<const Variable*, std::list<ValueFlow::Value>>& vars)
5507{
5508 const bool r = productParams(settings, vars, [&](const std::unordered_map<const Variable*, ValueFlow::Value>& arg) {
5509 auto a = makeMultiValueFlowAnalyzer(arg, settings);
5510 valueFlowGenericForward(const_cast<Token*>(functionScope->bodyStart),
5511 functionScope->bodyEnd,
5512 a,
5513 tokenlist,
5514 errorLogger,
5515 settings);
5516 });
5517 if (!r) {
5518 std::string fname = "<unknown>";
5519 if (const Function* f = functionScope->function)
5520 fname = f->name();
5521 if (settings.debugwarnings)
5522 bailout(tokenlist, errorLogger, functionScope->bodyStart, "Too many argument passed to " + fname);
5523 }
5524}
5525
5526static void valueFlowInjectParameter(const TokenList& tokenlist,
5527 ErrorLogger& errorLogger,

Callers 2

valueFlowSubFunctionFunction · 0.85

Calls 9

productParamsFunction · 0.85
valueFlowGenericForwardFunction · 0.85
valueFlowForwardFunction · 0.85
isConstMethod · 0.80
isClassMethod · 0.80
nextMethod · 0.80
nameMethod · 0.45
nameTokenMethod · 0.45

Tested by

no test coverage detected