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

Method astParent

lib/token.cpp:1422–1439  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1420}
1421
1422void Token::astParent(Token* tok)
1423{
1424 const Token* tok2 = tok;
1425 while (tok2) {
1426 if (this == tok2)
1427 throw InternalError(this, "Internal error. AST cyclic dependency.");
1428 tok2 = tok2->astParent();
1429 }
1430 // Clear children to avoid nodes referenced twice
1431 if (this->astParent()) {
1432 Token* parent = this->astParent();
1433 if (parent->astOperand1() == this)
1434 parent->mImpl->mAstOperand1 = nullptr;
1435 if (parent->astOperand2() == this)
1436 parent->mImpl->mAstOperand2 = nullptr;
1437 }
1438 mImpl->mAstParent = tok;
1439}
1440
1441void Token::astOperand1(Token *tok)
1442{

Callers 15

isUnchangedFunction · 0.80
checkRecursiveMethod · 0.80
fwdanalysis.cppFile · 0.80
isPointerDeRefMethod · 0.80
getOverrunIndexValuesFunction · 0.80
arrayIndexMethod · 0.80
bufferOverflowMethod · 0.80
arrayIndexThenCheckMethod · 0.80
objectIndexErrorMethod · 0.80

Calls 2

astOperand1Method · 0.80
astOperand2Method · 0.80

Tested by 2