From 6e6b3747fd7c42a0615285b90a461d294ddd7593 Mon Sep 17 00:00:00 2001 From: Mark Hermeling Date: Wed, 13 Sep 2023 16:35:14 -0400 Subject: [PATCH] Fix copy-paste-error (#5444) This is a warning we found during static analyis with CodeSecure CodeSonar. It flagged a suspicious copy-paste error, where it finds code that seems to have been copied from another location, with some, but not all, variables substituted. Unclear to me if this truly is a problem, or intentional, but I wanted to provide the feedback as I am not sure how to test this. Lines 5614 to 5619 in lib/symboldatabase.cpp are a copy from 5597-5602 with vartok replaced by valuetok, except for line 5616 --- lib/symboldatabase.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/symboldatabase.cpp b/lib/symboldatabase.cpp index 3fd3b4c88..9066592a9 100644 --- a/lib/symboldatabase.cpp +++ b/lib/symboldatabase.cpp @@ -5638,7 +5638,7 @@ const Function* Scope::findFunction(const Token *tok, bool requireConst) const } const Token* valuetok = arguments[j]; if (valuetok->str() == "::") { - const Token* rml = nextAfterAstRightmostLeaf(vartok); + const Token* rml = nextAfterAstRightmostLeaf(valuetok); if (rml) valuetok = rml->previous(); }