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

Function getLifetimeToken

lib/valueflow.cpp:1689–1700  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1687}
1688
1689static const Token* getLifetimeToken(const Token* tok, ErrorPath& errorPath, const Settings& settings, bool* addressOf = nullptr)
1690{
1691 std::vector<ValueFlow::LifetimeToken> lts = ValueFlow::getLifetimeTokens(tok, settings);
1692 if (lts.size() != 1)
1693 return nullptr;
1694 if (lts.front().inconclusive)
1695 return nullptr;
1696 if (addressOf)
1697 *addressOf = lts.front().addressOf;
1698 errorPath.insert(errorPath.end(), lts.front().errorPath.cbegin(), lts.front().errorPath.cend());
1699 return lts.front().token;
1700}
1701
1702const Variable* ValueFlow::getLifetimeVariable(const Token* tok, ErrorPath& errorPath, const Settings& settings, bool* addressOf)
1703{

Callers 1

getLifetimeVariableMethod · 0.85

Calls 4

getLifetimeTokensFunction · 0.85
frontMethod · 0.80
sizeMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected