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

Method get

lib/programmemory.cpp:591–607  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

589}
590
591ProgramMemory ProgramMemoryState::get(const Token* tok, const Token* ctx, const ProgramMemory::Map& vars) const
592{
593 ProgramMemoryState local = *this;
594 if (ctx)
595 local.addState(ctx, vars);
596 const Token* start = previousBeforeAstLeftmostLeaf(tok);
597 if (!start)
598 start = tok;
599
600 if (!ctx || precedes(start, ctx)) {
601 local.removeModifiedVars(start);
602 local.addState(start, vars);
603 } else {
604 local.removeModifiedVars(ctx);
605 }
606 return local.state;
607}
608
609ProgramMemory getProgramMemory(const Token* tok, const Token* expr, const ValueFlow::Value& value, const Settings& settings)
610{

Callers 15

get_checkers.pyFile · 0.45
listCertFilesFunction · 0.45
printCertCInfoFunction · 0.45
ftp_getFunction · 0.45
count_errorsFunction · 0.45
crashReportFunction · 0.45
staleReportFunction · 0.45
messageIdReportFunction · 0.45
timeReportFunction · 0.45
checks.cppFile · 0.45

Calls 4

precedesFunction · 0.85
addStateMethod · 0.80
removeModifiedVarsMethod · 0.80

Tested by 15

ftp_getFunction · 0.36
checkMethod · 0.36
assertRegex_Method · 0.36
checkMethod · 0.36
FileLocationConstructMethod · 0.36
checkMethod · 0.36
test_sarif_cwe_tagsFunction · 0.36
test_lookup_pathFunction · 0.36