mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Kotlin: Add a Kotlin 2 copy of the testsuite
This commit is contained in:
22
java/ql/test-kotlin2/library-tests/dataflow/foreach/C1.java
Normal file
22
java/ql/test-kotlin2/library-tests/dataflow/foreach/C1.java
Normal file
@@ -0,0 +1,22 @@
|
||||
public final class C1 {
|
||||
public final String taint(String t) {
|
||||
return t;
|
||||
}
|
||||
|
||||
public final void sink(Object a) {
|
||||
}
|
||||
|
||||
public final void test() {
|
||||
String[] l = new String[]{this.taint("a"), ""};
|
||||
this.sink(l);
|
||||
this.sink(l[0]);
|
||||
|
||||
for(int i = 0; i < l.length; i++) {
|
||||
this.sink(l[i]);
|
||||
}
|
||||
|
||||
for (String s : l) {
|
||||
this.sink(s);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user