mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Java: Add support for flow through side-effects on static fields.
This commit is contained in:
21
java/ql/test/library-tests/dataflow/fields/G.java
Normal file
21
java/ql/test/library-tests/dataflow/fields/G.java
Normal file
@@ -0,0 +1,21 @@
|
||||
public class G {
|
||||
static Object[] f;
|
||||
|
||||
void sink(Object o) { }
|
||||
|
||||
void runsink() {
|
||||
sink(f[0]);
|
||||
}
|
||||
|
||||
void test1() {
|
||||
f[0] = new Object();
|
||||
}
|
||||
|
||||
void test2() {
|
||||
addObj(f);
|
||||
}
|
||||
|
||||
void addObj(Object[] xs) {
|
||||
xs[0] = new Object();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user