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

Function getContainerFromSize

lib/checkstl.cpp:118–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

116}
117
118static const Token* getContainerFromSize(const Library::Container* container, const Token* tok)
119{
120 if (!tok)
121 return nullptr;
122 if (Token::Match(tok->tokAt(-2), ". %name% (")) {
123 const Library::Container::Yield yield = container->getYield(tok->strAt(-1));
124 if (yield == Library::Container::Yield::SIZE)
125 return tok->tokAt(-2)->astOperand1();
126 }
127 return nullptr;
128}
129
130void CheckStlImpl::outOfBounds()
131{

Callers 1

outOfBoundsMethod · 0.85

Calls 3

getYieldMethod · 0.80
astOperand1Method · 0.80
tokAtMethod · 0.45

Tested by

no test coverage detected