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

Function analyzeMatch

lib/vf_analyzers.cpp:571–588  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

569 }
570
571 Action analyzeMatch(const Token* tok, Direction d) const {
572 const Token* parent = tok->astParent();
573 if (d == Direction::Reverse && isGlobal() && !dependsOnThis() && Token::Match(parent, ". %name% (")) {
574 Action a = isGlobalModified(parent->next());
575 if (a != Action::None)
576 return a;
577 }
578 if ((astIsPointer(tok) || astIsSmartPointer(tok)) &&
579 (Token::Match(parent, "*|[") || (parent && parent->originalName() == "->")) && getIndirect(tok) <= 0)
580 return Action::Read;
581
582 Action w = isWritable(tok, d);
583 if (w != Action::None)
584 return w;
585
586 // Check for modifications by function calls
587 return isModified(tok);
588 }
589
590 Action analyzeToken(const Token* ref, const Token* tok, Direction d, bool inconclusiveRef) const {
591 if (!ref)

Callers 1

analyzeTokenFunction · 0.85

Calls 10

dependsOnThisFunction · 0.85
isGlobalModifiedFunction · 0.85
astIsPointerFunction · 0.85
astIsSmartPointerFunction · 0.85
getIndirectFunction · 0.85
isWritableFunction · 0.85
astParentMethod · 0.80
nextMethod · 0.80
isGlobalFunction · 0.70
isModifiedFunction · 0.70

Tested by

no test coverage detected