Try to fix issue 9341: daca crash: isContainerSizeChangedByFunction (#2168)
This commit is contained in:
parent
da29a1f56b
commit
ddb1f1b5ce
|
@ -5322,17 +5322,19 @@ static bool isContainerSizeChangedByFunction(const Token *tok, int depth = 20)
|
||||||
const Function * fun = ftok->function();
|
const Function * fun = ftok->function();
|
||||||
if (fun) {
|
if (fun) {
|
||||||
const Variable *arg = fun->getArgumentVar(narg);
|
const Variable *arg = fun->getArgumentVar(narg);
|
||||||
if (!arg->isReference() && !addressOf)
|
if (arg) {
|
||||||
return false;
|
if (!arg->isReference() && !addressOf)
|
||||||
if (arg->isConst())
|
|
||||||
return false;
|
|
||||||
const Scope * scope = fun->functionScope;
|
|
||||||
if (scope) {
|
|
||||||
// Argument not used
|
|
||||||
if (!arg->nameToken())
|
|
||||||
return false;
|
return false;
|
||||||
if (depth > 0)
|
if (arg->isConst())
|
||||||
return isContainerSizeChanged(arg->declarationId(), scope->bodyStart, scope->bodyEnd, depth - 1);
|
return false;
|
||||||
|
const Scope * scope = fun->functionScope;
|
||||||
|
if (scope) {
|
||||||
|
// Argument not used
|
||||||
|
if (!arg->nameToken())
|
||||||
|
return false;
|
||||||
|
if (depth > 0)
|
||||||
|
return isContainerSizeChanged(arg->declarationId(), scope->bodyStart, scope->bodyEnd, depth - 1);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue