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

Method getReallocFuncInfo

lib/library.cpp:1290–1298  ·  view source on GitHub ↗

get reallocation info for function */

Source from the content-addressed store, hash-verified

1288
1289/** get reallocation info for function */
1290const Library::AllocFunc* Library::getReallocFuncInfo(const Token *tok) const
1291{
1292 while (Token::simpleMatch(tok, "::"))
1293 tok = tok->astOperand2() ? tok->astOperand2() : tok->astOperand1();
1294 if (!tok)
1295 return nullptr;
1296 const std::string funcname = getFunctionName(tok);
1297 return isNotLibraryFunction(tok) && mData->mFunctions.find(funcname) != mData->mFunctions.end() ? nullptr : getAllocDealloc(mData->mRealloc, funcname);
1298}
1299
1300/** get allocation id for function */
1301int Library::getAllocId(const Token *tok, int arg) const

Callers 8

getReallocationTypeMethod · 0.80
checkReallocUsageMethod · 0.80
functionCallMethod · 0.80
copyconstructorsMethod · 0.80
checkMemsetMethod · 0.80

Calls 6

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

Tested by

no test coverage detected