Skip to content

Commit 9f106d7

Browse files
authored
Merge pull request #813 from github/lcartey/scope-performance-fix
`IdentifierHiding`: Improve performance, address some false positives/false negatives
2 parents 16bfd28 + 4d31f5f commit 9f106d7

File tree

9 files changed

+416
-217
lines changed

9 files changed

+416
-217
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
- `A2-10-1` - `IdentifierHiding.ql`:
2+
- Improved evaluation performance.
3+
- Addressed false negatives where nested loops used the same variable name.
4+
- Exclude cases where a variable declared in a lambda expression shadowed a global or namespace variable that did not appear in the same translation unit.
5+
- `RULE-5-3` - `IdentifierHidingC.ql`:
6+
- Improved evaluation performance.
7+
- Addressed false negatives where nested loops used the same variable name.

cpp/cert/src/rules/DCL53-CPP/LocalConstructorInitializedObjectHidesIdentifier.ql

+1-1
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,6 @@ from UserVariable v, UserVariable hidden
2020
where
2121
not isExcluded(v, ScopePackage::localConstructorInitializedObjectHidesIdentifierQuery()) and
2222
v.getInitializer().getExpr() instanceof ConstructorCall and
23-
hides(hidden, v)
23+
hidesStrict(hidden, v)
2424
select v, "The declaration declares variable " + v.getName() + " that hides $@", hidden,
2525
hidden.getName()

cpp/cert/src/rules/DCL53-CPP/LocalFunctionDeclaration.ql

-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313

1414
import cpp
1515
import codingstandards.cpp.cert
16-
import codingstandards.cpp.Scope
1716

1817
class LocalUserFunctionDeclarationEntry extends FunctionDeclarationEntry {
1918
DeclStmt ds;

0 commit comments

Comments
 (0)