One more fix for Function::isSafe
This commit is contained in:
parent
09be07f2b2
commit
4611cbb5bb
|
@ -2089,13 +2089,19 @@ const Token * Function::constructorMemberInitialization() const
|
|||
bool Function::isSafe(const Settings *settings) const
|
||||
{
|
||||
if (settings->safeChecks.externalFunctions) {
|
||||
if (nestedIn->type == Scope::ScopeType::eGlobal || nestedIn->type == Scope::ScopeType::eNamespace)
|
||||
return (token->fileIndex() != 0 || !isStatic());
|
||||
if (nestedIn->type == Scope::ScopeType::eGlobal || nestedIn->type == Scope::ScopeType::eNamespace) {
|
||||
if (token->fileIndex() != 0 || !isStatic()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (settings->safeChecks.internalFunctions) {
|
||||
if (nestedIn->type == Scope::ScopeType::eGlobal || nestedIn->type == Scope::ScopeType::eNamespace)
|
||||
return (token->fileIndex() == 0 && isStatic());
|
||||
if (nestedIn->type == Scope::ScopeType::eGlobal || nestedIn->type == Scope::ScopeType::eNamespace) {
|
||||
if (token->fileIndex() == 0 && isStatic()) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (settings->safeChecks.classes && access == AccessControl::Public) {
|
||||
|
|
Loading…
Reference in New Issue