From 32422c815bf953ab8ad84226131330c457da5441 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Marjam=C3=A4ki?= Date: Wed, 2 Aug 2017 08:17:29 +0200 Subject: [PATCH] Fix issue found by Coverity, scope cant be null since scope is dereferenced on all paths before the while and also unconditionally inside while --- lib/symboldatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index dd2950d3c..7771c6a92 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -3690,7 +3690,7 @@ const Enumerator * SymbolDatabase::findEnumerator(const Token * tok) const } } - while (scope && scope->nestedIn) { + while (scope->nestedIn) { if (scope->type == Scope::eFunction && scope->functionOf) scope = scope->functionOf; else