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

Method check

lib/checkleakautovar.cpp:163–185  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

161
162
163void CheckLeakAutoVarImpl::check()
164{
165 if (mSettings.clang)
166 return;
167
168 logChecker("CheckLeakAutoVar::check"); // notclang
169
170 const SymbolDatabase *symbolDatabase = mTokenizer->getSymbolDatabase();
171
172 // Local variables that are known to be non-zero.
173 const std::set<int> notzero;
174
175 // Check function scopes
176 for (const Scope * scope : symbolDatabase->functionScopes) {
177 if (scope->hasInlineOrLambdaFunction())
178 continue;
179
180 // Empty variable info
181 VarInfo varInfo;
182
183 checkScope(scope->bodyStart, varInfo, notzero, 0);
184 }
185}
186
187static bool isVarUsedInTree(const Token *tok, nonneg int varid)
188{

Callers 1

runChecksMethod · 0.45

Calls 2

checkScopeFunction · 0.85

Tested by

no test coverage detected