Merge pull request #9233 from atorralba/atorralba/fix-field-init-test

Kotlin: Fix test to correctly highlight lack of flow from field init
This commit is contained in:
Tony Torralba
2022-05-20 14:37:22 +02:00
committed by GitHub
2 changed files with 2 additions and 5 deletions

View File

@@ -1,4 +1,3 @@
isFinalField
| test.kt:3:3:3:18 | x |
#select
| test.kt:3:3:3:18 | this.x | test.kt:6:10:6:10 | getX(...) |
#select

View File

@@ -4,9 +4,7 @@ import semmle.code.java.dataflow.DataFlow
class Config extends DataFlow::Configuration {
Config() { this = "Config" }
override predicate isSource(DataFlow::Node n) {
n.asExpr().(CompileTimeConstantExpr).getStringValue() = "Source"
}
override predicate isSource(DataFlow::Node n) { n.asExpr().(StringLiteral).getValue() = "Source" }
override predicate isSink(DataFlow::Node n) {
n.asExpr().(Argument).getCall().getCallee().getName() = "sink"