Bug hunting: prevent recursion in analysis when code calls self
This commit is contained in:
parent
be16b2c276
commit
0ccc5c695b
|
@ -1952,6 +1952,11 @@ static ExprEngine::ValuePtr executeFunctionCall(const Token *tok, Data &data)
|
|||
|
||||
bool hasBody = tok->astOperand1()->function() && tok->astOperand1()->function()->hasBody();
|
||||
if (hasBody) {
|
||||
const Scope *functionScope = tok->scope();
|
||||
while (functionScope->isExecutable() && functionScope->type != Scope::ScopeType::eFunction)
|
||||
functionScope = functionScope->nestedIn;
|
||||
if (functionScope == tok->astOperand1()->function()->functionScope)
|
||||
hasBody = false;
|
||||
for (const auto &errorPathItem: data.errorPath) {
|
||||
if (errorPathItem.first == tok) {
|
||||
hasBody = false;
|
||||
|
|
Loading…
Reference in New Issue