Fix suspicious code found by Coverity, dont check if scope->function is null and then dereference it
This commit is contained in:
parent
058c439b2a
commit
1758c3b4e7
|
@ -3945,9 +3945,9 @@ const Function* Scope::findFunction(const Token *tok, bool requireConst) const
|
|||
const Scope * scope = tok->scope();
|
||||
|
||||
// check if this function is a member function
|
||||
if (scope && scope->functionOf && scope->functionOf->isClassOrStruct()) {
|
||||
if (scope && scope->functionOf && scope->functionOf->isClassOrStruct() && scope->function) {
|
||||
// check if isConst mismatches
|
||||
if (!(scope->function && scope->function->isConst() == func->isConst())) {
|
||||
if (scope->function->isConst() != func->isConst()) {
|
||||
if (scope->function->isConst()) {
|
||||
if (!erased)
|
||||
++i;
|
||||
|
|
Loading…
Reference in New Issue