forked from semgrep/semgrep
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Constant propagation of this.field (semgrep#2283)
Fixes semgrep#2247 test plan: test file included
- Loading branch information
Yoann Padioleau
authored
Dec 17, 2020
1 parent
ed32879
commit 4aa2a46
Showing
5 changed files
with
19 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule pfff
updated
from ac5c2a to 1779e8
11 changes: 11 additions & 0 deletions
11
semgrep-core/tests/java/equivalence_constant_propagation_field.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
class Foo { | ||
private final String FIELD = "password"; | ||
|
||
void test() { | ||
//ERROR: match | ||
foo(FIELD); | ||
|
||
//ERROR: match | ||
foo(this.FIELD); | ||
} | ||
} |
1 change: 1 addition & 0 deletions
1
semgrep-core/tests/java/equivalence_constant_propagation_field.sgrep
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
foo("password") |