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

Method isModified

lib/vf_analyzers.cpp:1573–1584  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1571 }
1572
1573 Action isModified(const Token* tok) const override {
1574 // An iterator won't change the container size
1575 if (astIsIterator(tok))
1576 return Action::Read;
1577 if (Token::Match(tok->astParent(), "%assign%") && astIsLHS(tok))
1578 return Action::Invalid;
1579 if (isLikelyStreamRead(tok->astParent()))
1580 return Action::Invalid;
1581 if (astIsContainer(tok) && ValueFlow::isContainerSizeChanged(tok, getIndirect(tok), getSettings()))
1582 return Action::Read | Action::Invalid;
1583 return Action::Read;
1584 }
1585};
1586
1587static const Token* solveExprValue(const Token* expr, ValueFlow::Value& value)

Callers 1

analyzeTokenFunction · 0.45

Calls 7

astIsIteratorFunction · 0.85
astIsLHSFunction · 0.85
isLikelyStreamReadFunction · 0.85
astIsContainerFunction · 0.85
isContainerSizeChangedFunction · 0.85
getIndirectFunction · 0.85
astParentMethod · 0.80

Tested by

no test coverage detected