Skip to content

Commit

Permalink
Fix copy-paste-error (#5444)
Browse files Browse the repository at this point in the history
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
  • Loading branch information
markhermeling authored Sep 13, 2023
1 parent a1078f4 commit 6e6b374
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion lib/symboldatabase.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}
Expand Down

0 comments on commit 6e6b374

Please sign in to comment.