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

Method isEscapedAlias

lib/fwdanalysis.cpp:583–600  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

581}
582
583bool FwdAnalysis::isEscapedAlias(const Token* expr)
584{
585 for (const Token *subexpr = expr; subexpr; subexpr = subexpr->astOperand1()) {
586 for (const ValueFlow::Value &val : subexpr->values()) {
587 if (!val.isLocalLifetimeValue())
588 continue;
589 const Variable* var = val.tokvalue->variable();
590 if (!var)
591 continue;
592 if (!var->isLocal())
593 return true;
594 if (var->isArgument())
595 return true;
596
597 }
598 }
599 return false;
600}

Callers

nothing calls this directly

Calls 2

astOperand1Method · 0.80
variableMethod · 0.80

Tested by

no test coverage detected