From 4611cbb5bba21968ca85cbe91a93ffb7839e0758 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Thu, 25 Jul 2019 17:31:52 +0200 Subject: [PATCH] One more fix for Function::isSafe --- lib/symboldatabase.cpp | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 577603797..7ebeb480b 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -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) {