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

Function getReturnValueFromOutparamAlloc

lib/checkleakautovar.cpp:285–292  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

283}
284
285static const Token* getReturnValueFromOutparamAlloc(const Token* alloc, const Settings& settings)
286{
287 if (const Token* ftok = getOutparamAllocation(alloc, settings)) {
288 if (Token::simpleMatch(ftok->astParent()->astParent(), "="))
289 return ftok->next()->astParent()->astOperand1();
290 }
291 return nullptr;
292}
293
294static std::vector<const Token*> getComparisonTokens(const Token* tok)
295{

Callers 1

checkScopeMethod · 0.85

Calls 5

getOutparamAllocationFunction · 0.85
astParentMethod · 0.80
astOperand1Method · 0.80
nextMethod · 0.80
simpleMatchFunction · 0.70

Tested by

no test coverage detected