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

Method getDeallocFuncInfo

lib/library.cpp:1279–1287  ·  view source on GitHub ↗

get deallocation info for function */

Source from the content-addressed store, hash-verified

1277
1278/** get deallocation info for function */
1279const Library::AllocFunc* Library::getDeallocFuncInfo(const Token *tok) const
1280{
1281 while (Token::simpleMatch(tok, "::"))
1282 tok = tok->astOperand2() ? tok->astOperand2() : tok->astOperand1();
1283 if (!tok)
1284 return nullptr;
1285 const std::string funcname = getFunctionName(tok);
1286 return isNotLibraryFunction(tok) && mData->mFunctions.find(funcname) != mData->mFunctions.end() ? nullptr : getAllocDealloc(mData->mDealloc, funcname);
1287}
1288
1289/** get reallocation info for function */
1290const Library::AllocFunc* Library::getReallocFuncInfo(const Token *tok) const

Callers 11

checkStructVariableMethod · 0.80
checkInvalidFreeMethod · 0.80
checkScopeMethod · 0.80
functionCallMethod · 0.80
copyconstructorsMethod · 0.80
hasAllocationMethod · 0.80
autoVariablesMethod · 0.80
memoryMethod · 0.80
memory3Method · 0.80

Calls 6

getAllocDeallocFunction · 0.85
astOperand2Method · 0.80
astOperand1Method · 0.80
simpleMatchFunction · 0.70
findMethod · 0.45
endMethod · 0.45

Tested by 2

memoryMethod · 0.64
memory3Method · 0.64