mirror of
https://github.com/github/codeql.git
synced 2026-04-29 18:55:14 +02:00
Merge pull request #10683 from smowton/smowton/feature/kotlin-function-overloads
Kotlin: implement $default function synthesis
This commit is contained in:
@@ -10,6 +10,8 @@ string visibility(Method m) {
|
||||
result = "internal" and m.isInternal()
|
||||
}
|
||||
|
||||
predicate hasPackagePrivateVisibility(Method m) { not exists(visibility(m)) }
|
||||
|
||||
// TODO: This ought to check more than just methods
|
||||
from Method m
|
||||
where
|
||||
@@ -19,5 +21,6 @@ where
|
||||
// TODO: This ought to have visibility information
|
||||
not m.getName() = "<clinit>" and
|
||||
count(visibility(m)) != 1 and
|
||||
not (count(visibility(m)) = 2 and visibility(m) = "public" and visibility(m) = "internal") // This is a reasonable result, since the JVM symbol is declared public, but Kotlin metadata flags it as internal
|
||||
not (count(visibility(m)) = 2 and visibility(m) = "public" and visibility(m) = "internal") and // This is a reasonable result, since the JVM symbol is declared public, but Kotlin metadata flags it as internal
|
||||
not (hasPackagePrivateVisibility(m) and m.getName().matches("%$default")) // This is a reasonable result because the $default forwarder methods corresponding to private methods are package-private.
|
||||
select m, concat(visibility(m), ", ")
|
||||
|
||||
@@ -65,7 +65,48 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 0| -3: [TypeAccess] Project
|
||||
# 0| 0: [VarAccess] name
|
||||
# 0| 1: [VarAccess] language
|
||||
# 0| 5: [Method] equals
|
||||
# 0| 5: [Method] copy$default
|
||||
# 0| 3: [TypeAccess] Project
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] p0
|
||||
# 0| 0: [TypeAccess] Project
|
||||
# 0| 1: [Parameter] p1
|
||||
# 0| 0: [TypeAccess] String
|
||||
# 0| 2: [Parameter] p2
|
||||
# 0| 0: [TypeAccess] int
|
||||
# 0| 3: [Parameter] p3
|
||||
# 0| 0: [TypeAccess] int
|
||||
# 0| 4: [Parameter] p4
|
||||
# 0| 0: [TypeAccess] Object
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [IfStmt] if (...)
|
||||
# 0| 0: [EQExpr] ... == ...
|
||||
# 0| 0: [AndBitwiseExpr] ... & ...
|
||||
# 0| 0: [IntegerLiteral] 1
|
||||
# 0| 1: [VarAccess] p3
|
||||
# 0| 1: [IntegerLiteral] 0
|
||||
# 0| 1: [ExprStmt] <Expr>;
|
||||
# 0| 0: [AssignExpr] ...=...
|
||||
# 0| 0: [VarAccess] p1
|
||||
# 0| 1: [VarAccess] p0.name
|
||||
# 0| -1: [VarAccess] p0
|
||||
# 0| 1: [IfStmt] if (...)
|
||||
# 0| 0: [EQExpr] ... == ...
|
||||
# 0| 0: [AndBitwiseExpr] ... & ...
|
||||
# 0| 0: [IntegerLiteral] 2
|
||||
# 0| 1: [VarAccess] p3
|
||||
# 0| 1: [IntegerLiteral] 0
|
||||
# 0| 1: [ExprStmt] <Expr>;
|
||||
# 0| 0: [AssignExpr] ...=...
|
||||
# 0| 0: [VarAccess] p2
|
||||
# 0| 1: [VarAccess] p0.language
|
||||
# 0| -1: [VarAccess] p0
|
||||
# 0| 2: [ReturnStmt] return ...
|
||||
# 0| 0: [MethodAccess] copy(...)
|
||||
# 0| -1: [VarAccess] p0
|
||||
# 0| 0: [VarAccess] p1
|
||||
# 0| 1: [VarAccess] p2
|
||||
# 0| 6: [Method] equals
|
||||
# 0| 3: [TypeAccess] boolean
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] other
|
||||
@@ -114,7 +155,7 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 0| 0: [BooleanLiteral] false
|
||||
# 0| 5: [ReturnStmt] return ...
|
||||
# 0| 0: [BooleanLiteral] true
|
||||
# 0| 6: [Method] hashCode
|
||||
# 0| 7: [Method] hashCode
|
||||
# 0| 3: [TypeAccess] int
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [LocalVariableDeclStmt] var ...;
|
||||
@@ -134,7 +175,7 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 2: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 7: [Method] toString
|
||||
# 0| 8: [Method] toString
|
||||
# 0| 3: [TypeAccess] String
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
@@ -148,7 +189,7 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 0| 5: [VarAccess] this.language
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 6: [StringLiteral] )
|
||||
# 0| 8: [Method] write$Self
|
||||
# 0| 9: [Method] write$Self
|
||||
# 0| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] self
|
||||
@@ -172,7 +213,7 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 7| 1: [IntegerLiteral] 1
|
||||
# 7| 2: [MethodAccess] getLanguage(...)
|
||||
# 7| -1: [VarAccess] self
|
||||
# 7| 9: [Class] $serializer
|
||||
# 7| 10: [Class] $serializer
|
||||
# 0| 1: [FieldDeclaration] SerialDescriptor descriptor;
|
||||
# 0| -1: [TypeAccess] SerialDescriptor
|
||||
# 0| 2: [Method] childSerializers
|
||||
@@ -384,7 +425,7 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 7| -1: [ThisAccess] $serializer.this
|
||||
# 7| 0: [TypeAccess] $serializer
|
||||
# 7| 1: [VarAccess] tmp0_serialDesc
|
||||
# 7| 10: [Class] Companion
|
||||
# 7| 11: [Class] Companion
|
||||
# 0| 1: [Method] serializer
|
||||
# 0| 3: [TypeAccess] KSerializer<Project>
|
||||
# 0| 0: [TypeAccess] Project
|
||||
@@ -395,7 +436,7 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 7| 5: [BlockStmt] { ... }
|
||||
# 7| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 7| 1: [BlockStmt] { ... }
|
||||
# 8| 11: [Constructor] Project
|
||||
# 8| 12: [Constructor] Project
|
||||
#-----| 4: (Parameters)
|
||||
# 8| 0: [Parameter] name
|
||||
# 8| 0: [TypeAccess] String
|
||||
@@ -410,21 +451,21 @@ app/src/main/kotlin/testProject/App.kt:
|
||||
# 8| 1: [ExprStmt] <Expr>;
|
||||
# 8| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 8| 0: [VarAccess] language
|
||||
# 8| 12: [FieldDeclaration] String name;
|
||||
# 8| 13: [FieldDeclaration] String name;
|
||||
# 8| -1: [TypeAccess] String
|
||||
# 8| 0: [VarAccess] name
|
||||
# 8| 13: [Method] getName
|
||||
# 8| 14: [Method] getName
|
||||
# 8| 3: [TypeAccess] String
|
||||
# 8| 5: [BlockStmt] { ... }
|
||||
# 8| 0: [ReturnStmt] return ...
|
||||
# 8| 0: [VarAccess] this.name
|
||||
# 8| -1: [ThisAccess] this
|
||||
# 8| 14: [Method] getLanguage
|
||||
# 8| 15: [Method] getLanguage
|
||||
# 8| 3: [TypeAccess] int
|
||||
# 8| 5: [BlockStmt] { ... }
|
||||
# 8| 0: [ReturnStmt] return ...
|
||||
# 8| 0: [VarAccess] this.language
|
||||
# 8| -1: [ThisAccess] this
|
||||
# 8| 15: [FieldDeclaration] int language;
|
||||
# 8| 16: [FieldDeclaration] int language;
|
||||
# 8| -1: [TypeAccess] int
|
||||
# 8| 0: [VarAccess] language
|
||||
|
||||
@@ -1,39 +0,0 @@
|
||||
public class User {
|
||||
|
||||
public static String source() { return "taint"; }
|
||||
|
||||
public static void test(Test2 t2, GenericTest<Integer> gt) {
|
||||
|
||||
Test.taintSuppliedAsDefault(1, "no taint", 2);
|
||||
Test.taintSuppliedAsDefault(1, 2);
|
||||
Test.noTaintByDefault(1, source(), 2, 3);
|
||||
Test.noTaintByDefault(1, source(), 2);
|
||||
|
||||
Test2.taintSuppliedAsDefaultStatic(1, "no taint", 2);
|
||||
Test2.taintSuppliedAsDefaultStatic(1, 2);
|
||||
Test2.noTaintByDefaultStatic(1, source(), 2, 3);
|
||||
Test2.noTaintByDefaultStatic(1, source(), 2);
|
||||
|
||||
t2.taintSuppliedAsDefault(1, "no taint", 2);
|
||||
t2.taintSuppliedAsDefault(1, 2);
|
||||
t2.noTaintByDefault(1, source(), 2, 3);
|
||||
t2.noTaintByDefault(1, source(), 2);
|
||||
|
||||
gt.taintSuppliedAsDefault(1, "no taint", 2);
|
||||
gt.taintSuppliedAsDefault(1, 2);
|
||||
gt.noTaintByDefault(1, source(), 2, 3);
|
||||
gt.noTaintByDefault(1, source(), 2);
|
||||
|
||||
new ConstructorTaintsByDefault(1, "no taint", 2);
|
||||
new ConstructorTaintsByDefault(1, 2);
|
||||
new ConstructorDoesNotTaintByDefault(1, source(), 2, 3);
|
||||
new ConstructorDoesNotTaintByDefault(1, source(), 2);
|
||||
|
||||
new GenericConstructorTaintsByDefault<Integer>(1, "no taint", 2);
|
||||
new GenericConstructorTaintsByDefault<Integer>(1, 2);
|
||||
new GenericConstructorDoesNotTaintByDefault<Integer>(1, source(), 2, 3);
|
||||
new GenericConstructorDoesNotTaintByDefault<Integer>(1, source(), 2);
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
@@ -1,19 +0,0 @@
|
||||
| User.java:9:30:9:37 | source(...) | test.kt:13:97:13:97 | s |
|
||||
| User.java:10:30:10:37 | source(...) | test.kt:13:97:13:97 | s |
|
||||
| User.java:14:37:14:44 | source(...) | test.kt:25:105:25:105 | s |
|
||||
| User.java:15:37:15:44 | source(...) | test.kt:25:105:25:105 | s |
|
||||
| User.java:19:28:19:35 | source(...) | test.kt:33:97:33:97 | s |
|
||||
| User.java:20:28:20:35 | source(...) | test.kt:33:97:33:97 | s |
|
||||
| User.java:24:28:24:35 | source(...) | test.kt:43:93:43:93 | s |
|
||||
| User.java:25:28:25:35 | source(...) | test.kt:43:93:43:93 | s |
|
||||
| User.java:29:45:29:52 | source(...) | test.kt:58:10:58:10 | s |
|
||||
| User.java:30:45:30:52 | source(...) | test.kt:58:10:58:10 | s |
|
||||
| User.java:34:61:34:68 | source(...) | test.kt:74:10:74:10 | s |
|
||||
| User.java:35:61:35:68 | source(...) | test.kt:74:10:74:10 | s |
|
||||
| test.kt:10:55:10:62 | source(...) | test.kt:10:84:10:84 | s |
|
||||
| test.kt:22:63:22:70 | source(...) | test.kt:22:92:22:92 | s |
|
||||
| test.kt:22:63:22:70 | source(...) | test.kt:22:92:22:92 | s |
|
||||
| test.kt:30:55:30:62 | source(...) | test.kt:30:84:30:84 | s |
|
||||
| test.kt:40:53:40:60 | source(...) | test.kt:40:80:40:80 | s |
|
||||
| test.kt:47:92:47:99 | source(...) | test.kt:50:10:50:10 | s |
|
||||
| test.kt:63:100:63:107 | source(...) | test.kt:66:10:66:10 | s |
|
||||
@@ -1,78 +0,0 @@
|
||||
fun getString() = "Hello world"
|
||||
|
||||
fun source() = "tainted"
|
||||
|
||||
fun sink(s: String) { }
|
||||
|
||||
object Test {
|
||||
|
||||
@JvmOverloads @JvmStatic
|
||||
fun taintSuppliedAsDefault(before: Int, s: String = source(), after: Int) { sink(s) }
|
||||
|
||||
@JvmOverloads @JvmStatic
|
||||
fun noTaintByDefault(before: Int, s: String = "no taint", after: Int, after2: Int = 1) { sink(s) }
|
||||
|
||||
}
|
||||
|
||||
public class Test2 {
|
||||
|
||||
companion object {
|
||||
|
||||
@JvmOverloads @JvmStatic
|
||||
fun taintSuppliedAsDefaultStatic(before: Int, s: String = source(), after: Int) { sink(s) }
|
||||
|
||||
@JvmOverloads @JvmStatic
|
||||
fun noTaintByDefaultStatic(before: Int, s: String = "no taint", after: Int, after2: Int = 1) { sink(s) }
|
||||
|
||||
}
|
||||
|
||||
@JvmOverloads
|
||||
fun taintSuppliedAsDefault(before: Int, s: String = source(), after: Int) { sink(s) }
|
||||
|
||||
@JvmOverloads
|
||||
fun noTaintByDefault(before: Int, s: String = "no taint", after: Int, after2: Int = 1) { sink(s) }
|
||||
|
||||
}
|
||||
|
||||
public class GenericTest<T> {
|
||||
|
||||
@JvmOverloads
|
||||
fun taintSuppliedAsDefault(before: T, s: String = source(), after: T) { sink(s) }
|
||||
|
||||
@JvmOverloads
|
||||
fun noTaintByDefault(before: T, s: String = "no taint", after: T, after2: Int = 1) { sink(s) }
|
||||
|
||||
}
|
||||
|
||||
public class ConstructorTaintsByDefault @JvmOverloads constructor(before: Int, s: String = source(), after: Int) {
|
||||
|
||||
init {
|
||||
sink(s)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class ConstructorDoesNotTaintByDefault @JvmOverloads constructor(before: Int, s: String = "no taint", after: Int, after2: Int = 1) {
|
||||
|
||||
init {
|
||||
sink(s)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class GenericConstructorTaintsByDefault<T> @JvmOverloads constructor(before: T, s: String = source(), after: T) {
|
||||
|
||||
init {
|
||||
sink(s)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
public class GenericConstructorDoesNotTaintByDefault<T> @JvmOverloads constructor(before: T, s: String = "no taint", after: T, after2: T? = null) {
|
||||
|
||||
init {
|
||||
sink(s)
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -1,4 +0,0 @@
|
||||
from create_database_utils import *
|
||||
|
||||
os.mkdir('kbuild')
|
||||
run_codeql_database_create(["kotlinc test.kt -d kbuild", "javac User.java -cp kbuild"], lang="java")
|
||||
@@ -1,18 +0,0 @@
|
||||
import java
|
||||
import semmle.code.java.dataflow.DataFlow
|
||||
|
||||
class Config extends DataFlow::Configuration {
|
||||
Config() { this = "config" }
|
||||
|
||||
override predicate isSource(DataFlow::Node n) {
|
||||
n.asExpr().(MethodAccess).getCallee().getName() = "source"
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node n) {
|
||||
n.asExpr().(Argument).getCall().getCallee().getName() = "sink"
|
||||
}
|
||||
}
|
||||
|
||||
from Config c, DataFlow::Node source, DataFlow::Node sink
|
||||
where c.hasFlow(source, sink)
|
||||
select source, sink
|
||||
@@ -65,6 +65,8 @@ class Element extends @element, Top {
|
||||
i = 8 and result = "Proxy static method for a @JvmStatic-annotated function or property"
|
||||
or
|
||||
i = 9 and result = "Forwarder for a @JvmOverloads-annotated function"
|
||||
or
|
||||
i = 10 and result = "Forwarder for Kotlin calls that need default arguments filling in"
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,7 +28,48 @@ dc.kt:
|
||||
# 0| -3: [TypeAccess] ProtoMapValue
|
||||
# 0| 0: [VarAccess] bytes
|
||||
# 0| 1: [VarAccess] strs
|
||||
# 0| 4: [Method] equals
|
||||
# 0| 4: [Method] copy$default
|
||||
# 0| 3: [TypeAccess] ProtoMapValue
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] p0
|
||||
# 0| 0: [TypeAccess] ProtoMapValue
|
||||
# 0| 1: [Parameter] p1
|
||||
# 0| 0: [TypeAccess] byte[]
|
||||
# 0| 2: [Parameter] p2
|
||||
# 0| 0: [TypeAccess] String[]
|
||||
# 0| 3: [Parameter] p3
|
||||
# 0| 0: [TypeAccess] int
|
||||
# 0| 4: [Parameter] p4
|
||||
# 0| 0: [TypeAccess] Object
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [IfStmt] if (...)
|
||||
# 0| 0: [EQExpr] ... == ...
|
||||
# 0| 0: [AndBitwiseExpr] ... & ...
|
||||
# 0| 0: [IntegerLiteral] 1
|
||||
# 0| 1: [VarAccess] p3
|
||||
# 0| 1: [IntegerLiteral] 0
|
||||
# 0| 1: [ExprStmt] <Expr>;
|
||||
# 0| 0: [AssignExpr] ...=...
|
||||
# 0| 0: [VarAccess] p1
|
||||
# 0| 1: [VarAccess] p0.bytes
|
||||
# 0| -1: [VarAccess] p0
|
||||
# 0| 1: [IfStmt] if (...)
|
||||
# 0| 0: [EQExpr] ... == ...
|
||||
# 0| 0: [AndBitwiseExpr] ... & ...
|
||||
# 0| 0: [IntegerLiteral] 2
|
||||
# 0| 1: [VarAccess] p3
|
||||
# 0| 1: [IntegerLiteral] 0
|
||||
# 0| 1: [ExprStmt] <Expr>;
|
||||
# 0| 0: [AssignExpr] ...=...
|
||||
# 0| 0: [VarAccess] p2
|
||||
# 0| 1: [VarAccess] p0.strs
|
||||
# 0| -1: [VarAccess] p0
|
||||
# 0| 2: [ReturnStmt] return ...
|
||||
# 0| 0: [MethodAccess] copy(...)
|
||||
# 0| -1: [VarAccess] p0
|
||||
# 0| 0: [VarAccess] p1
|
||||
# 0| 1: [VarAccess] p2
|
||||
# 0| 5: [Method] equals
|
||||
# 0| 3: [TypeAccess] boolean
|
||||
#-----| 4: (Parameters)
|
||||
# 0| 0: [Parameter] other
|
||||
@@ -77,7 +118,7 @@ dc.kt:
|
||||
# 0| 0: [BooleanLiteral] false
|
||||
# 0| 5: [ReturnStmt] return ...
|
||||
# 0| 0: [BooleanLiteral] true
|
||||
# 0| 5: [Method] hashCode
|
||||
# 0| 6: [Method] hashCode
|
||||
# 0| 3: [TypeAccess] int
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [LocalVariableDeclStmt] var ...;
|
||||
@@ -99,7 +140,7 @@ dc.kt:
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 2: [ReturnStmt] return ...
|
||||
# 0| 0: [VarAccess] result
|
||||
# 0| 6: [Method] toString
|
||||
# 0| 7: [Method] toString
|
||||
# 0| 3: [TypeAccess] String
|
||||
# 0| 5: [BlockStmt] { ... }
|
||||
# 0| 0: [ReturnStmt] return ...
|
||||
@@ -117,7 +158,7 @@ dc.kt:
|
||||
# 0| 0: [VarAccess] this.strs
|
||||
# 0| -1: [ThisAccess] this
|
||||
# 0| 6: [StringLiteral] )
|
||||
# 1| 7: [Constructor] ProtoMapValue
|
||||
# 1| 8: [Constructor] ProtoMapValue
|
||||
#-----| 4: (Parameters)
|
||||
# 1| 0: [Parameter] bytes
|
||||
# 1| 0: [TypeAccess] byte[]
|
||||
@@ -133,20 +174,20 @@ dc.kt:
|
||||
# 1| 1: [ExprStmt] <Expr>;
|
||||
# 1| 0: [KtInitializerAssignExpr] ...=...
|
||||
# 1| 0: [VarAccess] strs
|
||||
# 1| 8: [FieldDeclaration] byte[] bytes;
|
||||
# 1| 9: [FieldDeclaration] byte[] bytes;
|
||||
# 1| -1: [TypeAccess] byte[]
|
||||
# 1| 0: [VarAccess] bytes
|
||||
# 1| 9: [Method] getBytes
|
||||
# 1| 10: [Method] getBytes
|
||||
# 1| 3: [TypeAccess] byte[]
|
||||
# 1| 5: [BlockStmt] { ... }
|
||||
# 1| 0: [ReturnStmt] return ...
|
||||
# 1| 0: [VarAccess] this.bytes
|
||||
# 1| -1: [ThisAccess] this
|
||||
# 1| 10: [FieldDeclaration] String[] strs;
|
||||
# 1| 11: [FieldDeclaration] String[] strs;
|
||||
# 1| -1: [TypeAccess] String[]
|
||||
# 1| 0: [TypeAccess] String
|
||||
# 1| 0: [VarAccess] strs
|
||||
# 1| 11: [Method] getStrs
|
||||
# 1| 12: [Method] getStrs
|
||||
# 1| 3: [TypeAccess] String[]
|
||||
# 1| 0: [TypeAccess] String
|
||||
# 1| 5: [BlockStmt] { ... }
|
||||
|
||||
@@ -1,3 +1,4 @@
|
||||
| dc.kt:0:0:0:0 | copy(...) | ProtoMapValue.copy |
|
||||
| dc.kt:0:0:0:0 | hashCode(...) | java.util.Arrays.hashCode |
|
||||
| dc.kt:0:0:0:0 | hashCode(...) | java.util.Arrays.hashCode |
|
||||
| dc.kt:0:0:0:0 | new ProtoMapValue(...) | ProtoMapValue.ProtoMapValue |
|
||||
|
||||
@@ -69,6 +69,56 @@ test.kt:
|
||||
# 45| 5: [BlockStmt] { ... }
|
||||
# 45| 0: [ReturnStmt] return ...
|
||||
# 45| 0: [VarAccess] a
|
||||
# 45| 5: [Method] testExtensionFunction$default
|
||||
# 45| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 45| 0: [Parameter] p0
|
||||
# 45| 0: [TypeAccess] Test
|
||||
# 45| 1: [Parameter] p1
|
||||
# 45| 0: [TypeAccess] int
|
||||
# 45| 2: [Parameter] p2
|
||||
# 45| 0: [TypeAccess] String
|
||||
# 45| 3: [Parameter] p3
|
||||
# 45| 0: [TypeAccess] double
|
||||
# 45| 4: [Parameter] p4
|
||||
# 45| 0: [TypeAccess] float
|
||||
# 45| 5: [Parameter] p5
|
||||
# 45| 0: [TypeAccess] boolean
|
||||
# 45| 6: [Parameter] p6
|
||||
# 45| 0: [TypeAccess] int
|
||||
# 45| 7: [Parameter] p7
|
||||
# 45| 0: [TypeAccess] Object
|
||||
# 45| 5: [BlockStmt] { ... }
|
||||
# 45| 0: [IfStmt] if (...)
|
||||
# 45| 0: [EQExpr] ... == ...
|
||||
# 45| 0: [AndBitwiseExpr] ... & ...
|
||||
# 45| 0: [IntegerLiteral] 2
|
||||
# 45| 1: [VarAccess] p6
|
||||
# 45| 1: [IntegerLiteral] 0
|
||||
# 45| 1: [ExprStmt] <Expr>;
|
||||
# 45| 0: [AssignExpr] ...=...
|
||||
# 45| 0: [VarAccess] p2
|
||||
# 45| 1: [MethodAccess] getString(...)
|
||||
# 45| -1: [TypeAccess] TestKt
|
||||
# 45| 1: [IfStmt] if (...)
|
||||
# 45| 0: [EQExpr] ... == ...
|
||||
# 45| 0: [AndBitwiseExpr] ... & ...
|
||||
# 45| 0: [IntegerLiteral] 8
|
||||
# 45| 1: [VarAccess] p6
|
||||
# 45| 1: [IntegerLiteral] 0
|
||||
# 45| 1: [ExprStmt] <Expr>;
|
||||
# 45| 0: [AssignExpr] ...=...
|
||||
# 45| 0: [VarAccess] p4
|
||||
# 45| 1: [FloatLiteral] 1.0
|
||||
# 45| 2: [ReturnStmt] return ...
|
||||
# 45| 0: [MethodAccess] testExtensionFunction(...)
|
||||
# 45| -1: [TypeAccess] TestKt
|
||||
# 45| 0: [VarAccess] p0
|
||||
# 45| 1: [VarAccess] p1
|
||||
# 45| 2: [VarAccess] p2
|
||||
# 45| 3: [VarAccess] p3
|
||||
# 45| 4: [VarAccess] p4
|
||||
# 45| 5: [VarAccess] p5
|
||||
# 3| 2: [Class] Test
|
||||
# 3| 1: [Constructor] Test
|
||||
# 3| 5: [BlockStmt] { ... }
|
||||
@@ -129,7 +179,54 @@ test.kt:
|
||||
# 6| 5: [BlockStmt] { ... }
|
||||
# 6| 0: [ReturnStmt] return ...
|
||||
# 6| 0: [VarAccess] a
|
||||
# 9| 5: [Method] testMemberFunction
|
||||
# 6| 5: [Method] testStaticFunction$default
|
||||
# 6| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 6| 0: [Parameter] p0
|
||||
# 6| 0: [TypeAccess] int
|
||||
# 6| 1: [Parameter] p1
|
||||
# 6| 0: [TypeAccess] String
|
||||
# 6| 2: [Parameter] p2
|
||||
# 6| 0: [TypeAccess] double
|
||||
# 6| 3: [Parameter] p3
|
||||
# 6| 0: [TypeAccess] float
|
||||
# 6| 4: [Parameter] p4
|
||||
# 6| 0: [TypeAccess] boolean
|
||||
# 6| 5: [Parameter] p5
|
||||
# 6| 0: [TypeAccess] int
|
||||
# 6| 6: [Parameter] p6
|
||||
# 6| 0: [TypeAccess] Object
|
||||
# 6| 5: [BlockStmt] { ... }
|
||||
# 6| 0: [IfStmt] if (...)
|
||||
# 6| 0: [EQExpr] ... == ...
|
||||
# 6| 0: [AndBitwiseExpr] ... & ...
|
||||
# 6| 0: [IntegerLiteral] 2
|
||||
# 6| 1: [VarAccess] p5
|
||||
# 6| 1: [IntegerLiteral] 0
|
||||
# 6| 1: [ExprStmt] <Expr>;
|
||||
# 6| 0: [AssignExpr] ...=...
|
||||
# 6| 0: [VarAccess] p1
|
||||
# 6| 1: [MethodAccess] getString(...)
|
||||
# 6| -1: [TypeAccess] TestKt
|
||||
# 6| 1: [IfStmt] if (...)
|
||||
# 6| 0: [EQExpr] ... == ...
|
||||
# 6| 0: [AndBitwiseExpr] ... & ...
|
||||
# 6| 0: [IntegerLiteral] 8
|
||||
# 6| 1: [VarAccess] p5
|
||||
# 6| 1: [IntegerLiteral] 0
|
||||
# 6| 1: [ExprStmt] <Expr>;
|
||||
# 6| 0: [AssignExpr] ...=...
|
||||
# 6| 0: [VarAccess] p3
|
||||
# 6| 1: [FloatLiteral] 1.0
|
||||
# 6| 2: [ReturnStmt] return ...
|
||||
# 6| 0: [MethodAccess] testStaticFunction(...)
|
||||
# 6| -1: [TypeAccess] Test
|
||||
# 6| 0: [VarAccess] p0
|
||||
# 6| 1: [VarAccess] p1
|
||||
# 6| 2: [VarAccess] p2
|
||||
# 6| 3: [VarAccess] p3
|
||||
# 6| 4: [VarAccess] p4
|
||||
# 9| 6: [Method] testMemberFunction
|
||||
# 9| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 9| 0: [Parameter] a
|
||||
@@ -148,7 +245,7 @@ test.kt:
|
||||
# 9| 2: [VarAccess] c
|
||||
# 9| 3: [FloatLiteral] 1.0
|
||||
# 9| 4: [VarAccess] e
|
||||
# 9| 6: [Method] testMemberFunction
|
||||
# 9| 7: [Method] testMemberFunction
|
||||
# 9| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 9| 0: [Parameter] a
|
||||
@@ -168,7 +265,7 @@ test.kt:
|
||||
# 9| 2: [VarAccess] c
|
||||
# 9| 3: [FloatLiteral] 1.0
|
||||
# 9| 4: [VarAccess] e
|
||||
# 9| 7: [Method] testMemberFunction
|
||||
# 9| 8: [Method] testMemberFunction
|
||||
# 9| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 9| 0: [Parameter] a
|
||||
@@ -184,7 +281,56 @@ test.kt:
|
||||
# 9| 5: [BlockStmt] { ... }
|
||||
# 9| 0: [ReturnStmt] return ...
|
||||
# 9| 0: [VarAccess] a
|
||||
# 12| 8: [ExtensionMethod] testMemberExtensionFunction
|
||||
# 9| 9: [Method] testMemberFunction$default
|
||||
# 9| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 9| 0: [Parameter] p0
|
||||
# 9| 0: [TypeAccess] Test
|
||||
# 9| 1: [Parameter] p1
|
||||
# 9| 0: [TypeAccess] int
|
||||
# 9| 2: [Parameter] p2
|
||||
# 9| 0: [TypeAccess] String
|
||||
# 9| 3: [Parameter] p3
|
||||
# 9| 0: [TypeAccess] double
|
||||
# 9| 4: [Parameter] p4
|
||||
# 9| 0: [TypeAccess] float
|
||||
# 9| 5: [Parameter] p5
|
||||
# 9| 0: [TypeAccess] boolean
|
||||
# 9| 6: [Parameter] p6
|
||||
# 9| 0: [TypeAccess] int
|
||||
# 9| 7: [Parameter] p7
|
||||
# 9| 0: [TypeAccess] Object
|
||||
# 9| 5: [BlockStmt] { ... }
|
||||
# 9| 0: [IfStmt] if (...)
|
||||
# 9| 0: [EQExpr] ... == ...
|
||||
# 9| 0: [AndBitwiseExpr] ... & ...
|
||||
# 9| 0: [IntegerLiteral] 2
|
||||
# 9| 1: [VarAccess] p6
|
||||
# 9| 1: [IntegerLiteral] 0
|
||||
# 9| 1: [ExprStmt] <Expr>;
|
||||
# 9| 0: [AssignExpr] ...=...
|
||||
# 9| 0: [VarAccess] p2
|
||||
# 9| 1: [MethodAccess] getString(...)
|
||||
# 9| -1: [TypeAccess] TestKt
|
||||
# 9| 1: [IfStmt] if (...)
|
||||
# 9| 0: [EQExpr] ... == ...
|
||||
# 9| 0: [AndBitwiseExpr] ... & ...
|
||||
# 9| 0: [IntegerLiteral] 8
|
||||
# 9| 1: [VarAccess] p6
|
||||
# 9| 1: [IntegerLiteral] 0
|
||||
# 9| 1: [ExprStmt] <Expr>;
|
||||
# 9| 0: [AssignExpr] ...=...
|
||||
# 9| 0: [VarAccess] p4
|
||||
# 9| 1: [FloatLiteral] 1.0
|
||||
# 9| 2: [ReturnStmt] return ...
|
||||
# 9| 0: [MethodAccess] testMemberFunction(...)
|
||||
# 9| -1: [VarAccess] p0
|
||||
# 9| 0: [VarAccess] p1
|
||||
# 9| 1: [VarAccess] p2
|
||||
# 9| 2: [VarAccess] p3
|
||||
# 9| 3: [VarAccess] p4
|
||||
# 9| 4: [VarAccess] p5
|
||||
# 12| 10: [ExtensionMethod] testMemberExtensionFunction
|
||||
# 12| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 12| 0: [Parameter] <this>
|
||||
@@ -206,7 +352,7 @@ test.kt:
|
||||
# 12| 3: [VarAccess] c
|
||||
# 12| 4: [FloatLiteral] 1.0
|
||||
# 12| 5: [VarAccess] e
|
||||
# 12| 9: [ExtensionMethod] testMemberExtensionFunction
|
||||
# 12| 11: [ExtensionMethod] testMemberExtensionFunction
|
||||
# 12| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 12| 0: [Parameter] <this>
|
||||
@@ -229,7 +375,7 @@ test.kt:
|
||||
# 12| 3: [VarAccess] c
|
||||
# 12| 4: [FloatLiteral] 1.0
|
||||
# 12| 5: [VarAccess] e
|
||||
# 12| 10: [ExtensionMethod] testMemberExtensionFunction
|
||||
# 12| 12: [ExtensionMethod] testMemberExtensionFunction
|
||||
# 12| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 12| 0: [Parameter] <this>
|
||||
@@ -247,6 +393,58 @@ test.kt:
|
||||
# 12| 5: [BlockStmt] { ... }
|
||||
# 12| 0: [ReturnStmt] return ...
|
||||
# 12| 0: [VarAccess] a
|
||||
# 12| 13: [Method] testMemberExtensionFunction$default
|
||||
# 12| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 12| 0: [Parameter] p0
|
||||
# 12| 0: [TypeAccess] Test2
|
||||
# 12| 1: [Parameter] p1
|
||||
# 12| 0: [TypeAccess] Test
|
||||
# 12| 2: [Parameter] p2
|
||||
# 12| 0: [TypeAccess] int
|
||||
# 12| 3: [Parameter] p3
|
||||
# 12| 0: [TypeAccess] String
|
||||
# 12| 4: [Parameter] p4
|
||||
# 12| 0: [TypeAccess] double
|
||||
# 12| 5: [Parameter] p5
|
||||
# 12| 0: [TypeAccess] float
|
||||
# 12| 6: [Parameter] p6
|
||||
# 12| 0: [TypeAccess] boolean
|
||||
# 12| 7: [Parameter] p7
|
||||
# 12| 0: [TypeAccess] int
|
||||
# 12| 8: [Parameter] p8
|
||||
# 12| 0: [TypeAccess] Object
|
||||
# 12| 5: [BlockStmt] { ... }
|
||||
# 12| 0: [IfStmt] if (...)
|
||||
# 12| 0: [EQExpr] ... == ...
|
||||
# 12| 0: [AndBitwiseExpr] ... & ...
|
||||
# 12| 0: [IntegerLiteral] 2
|
||||
# 12| 1: [VarAccess] p7
|
||||
# 12| 1: [IntegerLiteral] 0
|
||||
# 12| 1: [ExprStmt] <Expr>;
|
||||
# 12| 0: [AssignExpr] ...=...
|
||||
# 12| 0: [VarAccess] p3
|
||||
# 12| 1: [MethodAccess] getString(...)
|
||||
# 12| -1: [TypeAccess] TestKt
|
||||
# 12| 1: [IfStmt] if (...)
|
||||
# 12| 0: [EQExpr] ... == ...
|
||||
# 12| 0: [AndBitwiseExpr] ... & ...
|
||||
# 12| 0: [IntegerLiteral] 8
|
||||
# 12| 1: [VarAccess] p7
|
||||
# 12| 1: [IntegerLiteral] 0
|
||||
# 12| 1: [ExprStmt] <Expr>;
|
||||
# 12| 0: [AssignExpr] ...=...
|
||||
# 12| 0: [VarAccess] p5
|
||||
# 12| 1: [FloatLiteral] 1.0
|
||||
# 12| 2: [ReturnStmt] return ...
|
||||
# 12| 0: [MethodAccess] testMemberExtensionFunction(...)
|
||||
# 12| -1: [VarAccess] p1
|
||||
# 12| 0: [VarAccess] p0
|
||||
# 12| 1: [VarAccess] p2
|
||||
# 12| 2: [VarAccess] p3
|
||||
# 12| 3: [VarAccess] p4
|
||||
# 12| 4: [VarAccess] p5
|
||||
# 12| 5: [VarAccess] p6
|
||||
# 16| 3: [Class] Test2
|
||||
# 16| 1: [Constructor] Test2
|
||||
#-----| 4: (Parameters)
|
||||
@@ -296,7 +494,51 @@ test.kt:
|
||||
# 16| 5: [BlockStmt] { ... }
|
||||
# 16| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 16| 1: [BlockStmt] { ... }
|
||||
# 18| 4: [Class] Companion
|
||||
# 16| 4: [Constructor] Test2
|
||||
#-----| 4: (Parameters)
|
||||
# 16| 0: [Parameter] p0
|
||||
# 16| 0: [TypeAccess] int
|
||||
# 16| 1: [Parameter] p1
|
||||
# 16| 0: [TypeAccess] String
|
||||
# 16| 2: [Parameter] p2
|
||||
# 16| 0: [TypeAccess] double
|
||||
# 16| 3: [Parameter] p3
|
||||
# 16| 0: [TypeAccess] float
|
||||
# 16| 4: [Parameter] p4
|
||||
# 16| 0: [TypeAccess] boolean
|
||||
# 16| 5: [Parameter] p5
|
||||
# 16| 0: [TypeAccess] int
|
||||
# 16| 6: [Parameter] p6
|
||||
# 16| 0: [TypeAccess] DefaultConstructorMarker
|
||||
# 16| 5: [BlockStmt] { ... }
|
||||
# 16| 0: [IfStmt] if (...)
|
||||
# 16| 0: [EQExpr] ... == ...
|
||||
# 16| 0: [AndBitwiseExpr] ... & ...
|
||||
# 16| 0: [IntegerLiteral] 2
|
||||
# 16| 1: [VarAccess] p5
|
||||
# 16| 1: [IntegerLiteral] 0
|
||||
# 16| 1: [ExprStmt] <Expr>;
|
||||
# 16| 0: [AssignExpr] ...=...
|
||||
# 16| 0: [VarAccess] p1
|
||||
# 16| 1: [MethodAccess] getString(...)
|
||||
# 16| -1: [TypeAccess] TestKt
|
||||
# 16| 1: [IfStmt] if (...)
|
||||
# 16| 0: [EQExpr] ... == ...
|
||||
# 16| 0: [AndBitwiseExpr] ... & ...
|
||||
# 16| 0: [IntegerLiteral] 8
|
||||
# 16| 1: [VarAccess] p5
|
||||
# 16| 1: [IntegerLiteral] 0
|
||||
# 16| 1: [ExprStmt] <Expr>;
|
||||
# 16| 0: [AssignExpr] ...=...
|
||||
# 16| 0: [VarAccess] p3
|
||||
# 16| 1: [FloatLiteral] 1.0
|
||||
# 16| 2: [ThisConstructorInvocationStmt] this(...)
|
||||
# 16| 0: [VarAccess] p0
|
||||
# 16| 1: [VarAccess] p1
|
||||
# 16| 2: [VarAccess] p2
|
||||
# 16| 3: [VarAccess] p3
|
||||
# 16| 4: [VarAccess] p4
|
||||
# 18| 5: [Class] Companion
|
||||
# 18| 1: [Constructor] Companion
|
||||
# 18| 5: [BlockStmt] { ... }
|
||||
# 18| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
@@ -356,7 +598,56 @@ test.kt:
|
||||
# 21| 5: [BlockStmt] { ... }
|
||||
# 21| 0: [ReturnStmt] return ...
|
||||
# 21| 0: [VarAccess] a
|
||||
# 24| 5: [Method] testStaticCompanionFunction
|
||||
# 21| 5: [Method] testCompanionFunction$default
|
||||
# 21| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 21| 0: [Parameter] p0
|
||||
# 21| 0: [TypeAccess] Companion
|
||||
# 21| 1: [Parameter] p1
|
||||
# 21| 0: [TypeAccess] int
|
||||
# 21| 2: [Parameter] p2
|
||||
# 21| 0: [TypeAccess] String
|
||||
# 21| 3: [Parameter] p3
|
||||
# 21| 0: [TypeAccess] double
|
||||
# 21| 4: [Parameter] p4
|
||||
# 21| 0: [TypeAccess] float
|
||||
# 21| 5: [Parameter] p5
|
||||
# 21| 0: [TypeAccess] boolean
|
||||
# 21| 6: [Parameter] p6
|
||||
# 21| 0: [TypeAccess] int
|
||||
# 21| 7: [Parameter] p7
|
||||
# 21| 0: [TypeAccess] Object
|
||||
# 21| 5: [BlockStmt] { ... }
|
||||
# 21| 0: [IfStmt] if (...)
|
||||
# 21| 0: [EQExpr] ... == ...
|
||||
# 21| 0: [AndBitwiseExpr] ... & ...
|
||||
# 21| 0: [IntegerLiteral] 2
|
||||
# 21| 1: [VarAccess] p6
|
||||
# 21| 1: [IntegerLiteral] 0
|
||||
# 21| 1: [ExprStmt] <Expr>;
|
||||
# 21| 0: [AssignExpr] ...=...
|
||||
# 21| 0: [VarAccess] p2
|
||||
# 21| 1: [MethodAccess] getString(...)
|
||||
# 21| -1: [TypeAccess] TestKt
|
||||
# 21| 1: [IfStmt] if (...)
|
||||
# 21| 0: [EQExpr] ... == ...
|
||||
# 21| 0: [AndBitwiseExpr] ... & ...
|
||||
# 21| 0: [IntegerLiteral] 8
|
||||
# 21| 1: [VarAccess] p6
|
||||
# 21| 1: [IntegerLiteral] 0
|
||||
# 21| 1: [ExprStmt] <Expr>;
|
||||
# 21| 0: [AssignExpr] ...=...
|
||||
# 21| 0: [VarAccess] p4
|
||||
# 21| 1: [FloatLiteral] 1.0
|
||||
# 21| 2: [ReturnStmt] return ...
|
||||
# 21| 0: [MethodAccess] testCompanionFunction(...)
|
||||
# 21| -1: [VarAccess] p0
|
||||
# 21| 0: [VarAccess] p1
|
||||
# 21| 1: [VarAccess] p2
|
||||
# 21| 2: [VarAccess] p3
|
||||
# 21| 3: [VarAccess] p4
|
||||
# 21| 4: [VarAccess] p5
|
||||
# 24| 6: [Method] testStaticCompanionFunction
|
||||
# 24| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 24| 0: [Parameter] a
|
||||
@@ -375,7 +666,7 @@ test.kt:
|
||||
# 24| 2: [VarAccess] c
|
||||
# 24| 3: [FloatLiteral] 1.0
|
||||
# 24| 4: [VarAccess] e
|
||||
# 24| 6: [Method] testStaticCompanionFunction
|
||||
# 24| 7: [Method] testStaticCompanionFunction
|
||||
# 24| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 24| 0: [Parameter] a
|
||||
@@ -395,7 +686,7 @@ test.kt:
|
||||
# 24| 2: [VarAccess] c
|
||||
# 24| 3: [FloatLiteral] 1.0
|
||||
# 24| 4: [VarAccess] e
|
||||
# 24| 7: [Method] testStaticCompanionFunction
|
||||
# 24| 8: [Method] testStaticCompanionFunction
|
||||
# 24| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 24| 0: [Parameter] a
|
||||
@@ -411,7 +702,56 @@ test.kt:
|
||||
# 24| 5: [BlockStmt] { ... }
|
||||
# 24| 0: [ReturnStmt] return ...
|
||||
# 24| 0: [VarAccess] a
|
||||
# 24| 5: [Method] testStaticCompanionFunction
|
||||
# 24| 9: [Method] testStaticCompanionFunction$default
|
||||
# 24| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 24| 0: [Parameter] p0
|
||||
# 24| 0: [TypeAccess] Companion
|
||||
# 24| 1: [Parameter] p1
|
||||
# 24| 0: [TypeAccess] int
|
||||
# 24| 2: [Parameter] p2
|
||||
# 24| 0: [TypeAccess] String
|
||||
# 24| 3: [Parameter] p3
|
||||
# 24| 0: [TypeAccess] double
|
||||
# 24| 4: [Parameter] p4
|
||||
# 24| 0: [TypeAccess] float
|
||||
# 24| 5: [Parameter] p5
|
||||
# 24| 0: [TypeAccess] boolean
|
||||
# 24| 6: [Parameter] p6
|
||||
# 24| 0: [TypeAccess] int
|
||||
# 24| 7: [Parameter] p7
|
||||
# 24| 0: [TypeAccess] Object
|
||||
# 24| 5: [BlockStmt] { ... }
|
||||
# 24| 0: [IfStmt] if (...)
|
||||
# 24| 0: [EQExpr] ... == ...
|
||||
# 24| 0: [AndBitwiseExpr] ... & ...
|
||||
# 24| 0: [IntegerLiteral] 2
|
||||
# 24| 1: [VarAccess] p6
|
||||
# 24| 1: [IntegerLiteral] 0
|
||||
# 24| 1: [ExprStmt] <Expr>;
|
||||
# 24| 0: [AssignExpr] ...=...
|
||||
# 24| 0: [VarAccess] p2
|
||||
# 24| 1: [MethodAccess] getString(...)
|
||||
# 24| -1: [TypeAccess] TestKt
|
||||
# 24| 1: [IfStmt] if (...)
|
||||
# 24| 0: [EQExpr] ... == ...
|
||||
# 24| 0: [AndBitwiseExpr] ... & ...
|
||||
# 24| 0: [IntegerLiteral] 8
|
||||
# 24| 1: [VarAccess] p6
|
||||
# 24| 1: [IntegerLiteral] 0
|
||||
# 24| 1: [ExprStmt] <Expr>;
|
||||
# 24| 0: [AssignExpr] ...=...
|
||||
# 24| 0: [VarAccess] p4
|
||||
# 24| 1: [FloatLiteral] 1.0
|
||||
# 24| 2: [ReturnStmt] return ...
|
||||
# 24| 0: [MethodAccess] testStaticCompanionFunction(...)
|
||||
# 24| -1: [VarAccess] p0
|
||||
# 24| 0: [VarAccess] p1
|
||||
# 24| 1: [VarAccess] p2
|
||||
# 24| 2: [VarAccess] p3
|
||||
# 24| 3: [VarAccess] p4
|
||||
# 24| 4: [VarAccess] p5
|
||||
# 24| 6: [Method] testStaticCompanionFunction
|
||||
# 24| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 24| 0: [Parameter] a
|
||||
@@ -430,7 +770,7 @@ test.kt:
|
||||
# 24| 2: [VarAccess] c
|
||||
# 24| 3: [FloatLiteral] 1.0
|
||||
# 24| 4: [VarAccess] e
|
||||
# 24| 6: [Method] testStaticCompanionFunction
|
||||
# 24| 7: [Method] testStaticCompanionFunction
|
||||
# 24| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 24| 0: [Parameter] a
|
||||
@@ -450,7 +790,7 @@ test.kt:
|
||||
# 24| 2: [VarAccess] c
|
||||
# 24| 3: [FloatLiteral] 1.0
|
||||
# 24| 4: [VarAccess] e
|
||||
# 24| 7: [Method] testStaticCompanionFunction
|
||||
# 24| 8: [Method] testStaticCompanionFunction
|
||||
# 24| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 24| 0: [Parameter] a
|
||||
@@ -515,7 +855,47 @@ test.kt:
|
||||
# 30| 5: [BlockStmt] { ... }
|
||||
# 30| 0: [SuperConstructorInvocationStmt] super(...)
|
||||
# 30| 1: [BlockStmt] { ... }
|
||||
# 33| 4: [Method] testMemberFunction
|
||||
# 30| 4: [Constructor] GenericTest
|
||||
#-----| 4: (Parameters)
|
||||
# 30| 0: [Parameter] p0
|
||||
# 30| 0: [TypeAccess] int
|
||||
# 30| 1: [Parameter] p1
|
||||
# 30| 0: [TypeAccess] Object
|
||||
# 30| 2: [Parameter] p2
|
||||
# 30| 0: [TypeAccess] String
|
||||
# 30| 3: [Parameter] p3
|
||||
# 30| 0: [TypeAccess] Object
|
||||
# 30| 4: [Parameter] p4
|
||||
# 30| 0: [TypeAccess] int
|
||||
# 30| 5: [Parameter] p5
|
||||
# 30| 0: [TypeAccess] DefaultConstructorMarker
|
||||
# 30| 5: [BlockStmt] { ... }
|
||||
# 30| 0: [IfStmt] if (...)
|
||||
# 30| 0: [EQExpr] ... == ...
|
||||
# 30| 0: [AndBitwiseExpr] ... & ...
|
||||
# 30| 0: [IntegerLiteral] 1
|
||||
# 30| 1: [VarAccess] p4
|
||||
# 30| 1: [IntegerLiteral] 0
|
||||
# 30| 1: [ExprStmt] <Expr>;
|
||||
# 30| 0: [AssignExpr] ...=...
|
||||
# 30| 0: [VarAccess] p0
|
||||
# 30| 1: [IntegerLiteral] 1
|
||||
# 30| 1: [IfStmt] if (...)
|
||||
# 30| 0: [EQExpr] ... == ...
|
||||
# 30| 0: [AndBitwiseExpr] ... & ...
|
||||
# 30| 0: [IntegerLiteral] 4
|
||||
# 30| 1: [VarAccess] p4
|
||||
# 30| 1: [IntegerLiteral] 0
|
||||
# 30| 1: [ExprStmt] <Expr>;
|
||||
# 30| 0: [AssignExpr] ...=...
|
||||
# 30| 0: [VarAccess] p2
|
||||
# 30| 1: [StringLiteral] Hello world
|
||||
# 30| 2: [ThisConstructorInvocationStmt] this(...)
|
||||
# 30| 0: [VarAccess] p0
|
||||
# 30| 1: [VarAccess] p1
|
||||
# 30| 2: [VarAccess] p2
|
||||
# 30| 3: [VarAccess] p3
|
||||
# 33| 5: [Method] testMemberFunction
|
||||
# 33| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 33| 0: [Parameter] b
|
||||
@@ -530,7 +910,7 @@ test.kt:
|
||||
# 33| 1: [VarAccess] b
|
||||
# 33| 2: [StringLiteral] Hello world
|
||||
# 33| 3: [VarAccess] d
|
||||
# 33| 5: [Method] testMemberFunction
|
||||
# 33| 6: [Method] testMemberFunction
|
||||
# 33| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 33| 0: [Parameter] a
|
||||
@@ -547,7 +927,7 @@ test.kt:
|
||||
# 33| 1: [VarAccess] b
|
||||
# 33| 2: [StringLiteral] Hello world
|
||||
# 33| 3: [VarAccess] d
|
||||
# 33| 6: [Method] testMemberFunction
|
||||
# 33| 7: [Method] testMemberFunction
|
||||
# 33| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 33| 0: [Parameter] a
|
||||
@@ -561,7 +941,52 @@ test.kt:
|
||||
# 33| 5: [BlockStmt] { ... }
|
||||
# 33| 0: [ReturnStmt] return ...
|
||||
# 33| 0: [VarAccess] a
|
||||
# 35| 7: [Method] useSpecialised
|
||||
# 33| 8: [Method] testMemberFunction$default
|
||||
# 33| 3: [TypeAccess] int
|
||||
#-----| 4: (Parameters)
|
||||
# 33| 0: [Parameter] p0
|
||||
# 33| 0: [TypeAccess] GenericTest<>
|
||||
# 33| 1: [Parameter] p1
|
||||
# 33| 0: [TypeAccess] int
|
||||
# 33| 2: [Parameter] p2
|
||||
# 33| 0: [TypeAccess] Object
|
||||
# 33| 3: [Parameter] p3
|
||||
# 33| 0: [TypeAccess] String
|
||||
# 33| 4: [Parameter] p4
|
||||
# 33| 0: [TypeAccess] Object
|
||||
# 33| 5: [Parameter] p5
|
||||
# 33| 0: [TypeAccess] int
|
||||
# 33| 6: [Parameter] p6
|
||||
# 33| 0: [TypeAccess] Object
|
||||
# 33| 5: [BlockStmt] { ... }
|
||||
# 33| 0: [IfStmt] if (...)
|
||||
# 33| 0: [EQExpr] ... == ...
|
||||
# 33| 0: [AndBitwiseExpr] ... & ...
|
||||
# 33| 0: [IntegerLiteral] 1
|
||||
# 33| 1: [VarAccess] p5
|
||||
# 33| 1: [IntegerLiteral] 0
|
||||
# 33| 1: [ExprStmt] <Expr>;
|
||||
# 33| 0: [AssignExpr] ...=...
|
||||
# 33| 0: [VarAccess] p1
|
||||
# 33| 1: [IntegerLiteral] 1
|
||||
# 33| 1: [IfStmt] if (...)
|
||||
# 33| 0: [EQExpr] ... == ...
|
||||
# 33| 0: [AndBitwiseExpr] ... & ...
|
||||
# 33| 0: [IntegerLiteral] 4
|
||||
# 33| 1: [VarAccess] p5
|
||||
# 33| 1: [IntegerLiteral] 0
|
||||
# 33| 1: [ExprStmt] <Expr>;
|
||||
# 33| 0: [AssignExpr] ...=...
|
||||
# 33| 0: [VarAccess] p3
|
||||
# 33| 1: [StringLiteral] Hello world
|
||||
# 33| 2: [ReturnStmt] return ...
|
||||
# 33| 0: [MethodAccess] testMemberFunction(...)
|
||||
# 33| -1: [VarAccess] p0
|
||||
# 33| 0: [VarAccess] p1
|
||||
# 33| 1: [VarAccess] p2
|
||||
# 33| 2: [VarAccess] p3
|
||||
# 33| 3: [VarAccess] p4
|
||||
# 35| 9: [Method] useSpecialised
|
||||
# 35| 3: [TypeAccess] Unit
|
||||
#-----| 4: (Parameters)
|
||||
# 35| 0: [Parameter] spec1
|
||||
|
||||
@@ -16,19 +16,24 @@
|
||||
| test.kt:0:0:0:0 | TestKt | test.kt:45:1:45:112 | testExtensionFunction | testExtensionFunction(Test,int,double,boolean) |
|
||||
| test.kt:0:0:0:0 | TestKt | test.kt:45:1:45:112 | testExtensionFunction | testExtensionFunction(Test,int,java.lang.String,double,boolean) |
|
||||
| test.kt:0:0:0:0 | TestKt | test.kt:45:1:45:112 | testExtensionFunction | testExtensionFunction(Test,int,java.lang.String,double,float,boolean) |
|
||||
| test.kt:0:0:0:0 | TestKt | test.kt:45:1:45:112 | testExtensionFunction$default | testExtensionFunction$default(Test,int,java.lang.String,double,float,boolean,int,java.lang.Object) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:3:1:14:1 | Test | Test() |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:6:3:6:106 | testStaticFunction | testStaticFunction(int,double,boolean) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:6:3:6:106 | testStaticFunction | testStaticFunction(int,java.lang.String,double,boolean) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:6:3:6:106 | testStaticFunction | testStaticFunction(int,java.lang.String,double,float,boolean) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:6:3:6:106 | testStaticFunction$default | testStaticFunction$default(int,java.lang.String,double,float,boolean,int,java.lang.Object) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:9:3:9:106 | testMemberFunction | testMemberFunction(int,double,boolean) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:9:3:9:106 | testMemberFunction | testMemberFunction(int,java.lang.String,double,boolean) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:9:3:9:106 | testMemberFunction | testMemberFunction(int,java.lang.String,double,float,boolean) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:9:3:9:106 | testMemberFunction$default | testMemberFunction$default(Test,int,java.lang.String,double,float,boolean,int,java.lang.Object) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:12:3:12:121 | testMemberExtensionFunction | testMemberExtensionFunction(Test2,int,double,boolean) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:12:3:12:121 | testMemberExtensionFunction | testMemberExtensionFunction(Test2,int,java.lang.String,double,boolean) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:12:3:12:121 | testMemberExtensionFunction | testMemberExtensionFunction(Test2,int,java.lang.String,double,float,boolean) |
|
||||
| test.kt:3:1:14:1 | Test | test.kt:12:3:12:121 | testMemberExtensionFunction$default | testMemberExtensionFunction$default(Test2,Test,int,java.lang.String,double,float,boolean,int,java.lang.Object) |
|
||||
| test.kt:16:1:28:1 | Test2 | test.kt:16:34:28:1 | Test2 | Test2(int,double,boolean) |
|
||||
| test.kt:16:1:28:1 | Test2 | test.kt:16:34:28:1 | Test2 | Test2(int,java.lang.String,double,boolean) |
|
||||
| test.kt:16:1:28:1 | Test2 | test.kt:16:34:28:1 | Test2 | Test2(int,java.lang.String,double,float,boolean) |
|
||||
| test.kt:16:1:28:1 | Test2 | test.kt:16:34:28:1 | Test2 | Test2(int,java.lang.String,double,float,boolean,int,kotlin.jvm.internal.DefaultConstructorMarker) |
|
||||
| test.kt:16:1:28:1 | Test2 | test.kt:24:5:24:117 | testStaticCompanionFunction | testStaticCompanionFunction(int,double,boolean) |
|
||||
| test.kt:16:1:28:1 | Test2 | test.kt:24:5:24:117 | testStaticCompanionFunction | testStaticCompanionFunction(int,java.lang.String,double,boolean) |
|
||||
| test.kt:16:1:28:1 | Test2 | test.kt:24:5:24:117 | testStaticCompanionFunction | testStaticCompanionFunction(int,java.lang.String,double,float,boolean) |
|
||||
@@ -36,13 +41,17 @@
|
||||
| test.kt:18:3:26:3 | Companion | test.kt:21:5:21:111 | testCompanionFunction | testCompanionFunction(int,double,boolean) |
|
||||
| test.kt:18:3:26:3 | Companion | test.kt:21:5:21:111 | testCompanionFunction | testCompanionFunction(int,java.lang.String,double,boolean) |
|
||||
| test.kt:18:3:26:3 | Companion | test.kt:21:5:21:111 | testCompanionFunction | testCompanionFunction(int,java.lang.String,double,float,boolean) |
|
||||
| test.kt:18:3:26:3 | Companion | test.kt:21:5:21:111 | testCompanionFunction$default | testCompanionFunction$default(Test2.Companion,int,java.lang.String,double,float,boolean,int,java.lang.Object) |
|
||||
| test.kt:18:3:26:3 | Companion | test.kt:24:5:24:117 | testStaticCompanionFunction | testStaticCompanionFunction(int,double,boolean) |
|
||||
| test.kt:18:3:26:3 | Companion | test.kt:24:5:24:117 | testStaticCompanionFunction | testStaticCompanionFunction(int,java.lang.String,double,boolean) |
|
||||
| test.kt:18:3:26:3 | Companion | test.kt:24:5:24:117 | testStaticCompanionFunction | testStaticCompanionFunction(int,java.lang.String,double,float,boolean) |
|
||||
| test.kt:18:3:26:3 | Companion | test.kt:24:5:24:117 | testStaticCompanionFunction$default | testStaticCompanionFunction$default(Test2.Companion,int,java.lang.String,double,float,boolean,int,java.lang.Object) |
|
||||
| test.kt:30:1:42:1 | GenericTest | test.kt:30:43:42:1 | GenericTest | GenericTest(int,java.lang.Object,java.lang.Object) |
|
||||
| test.kt:30:1:42:1 | GenericTest | test.kt:30:43:42:1 | GenericTest | GenericTest(int,java.lang.Object,java.lang.String,java.lang.Object) |
|
||||
| test.kt:30:1:42:1 | GenericTest | test.kt:30:43:42:1 | GenericTest | GenericTest(int,java.lang.Object,java.lang.String,java.lang.Object,int,kotlin.jvm.internal.DefaultConstructorMarker) |
|
||||
| test.kt:30:1:42:1 | GenericTest | test.kt:30:43:42:1 | GenericTest | GenericTest(java.lang.Object,java.lang.Object) |
|
||||
| test.kt:30:1:42:1 | GenericTest | test.kt:33:3:33:84 | testMemberFunction | testMemberFunction(int,java.lang.Object,java.lang.Object) |
|
||||
| test.kt:30:1:42:1 | GenericTest | test.kt:33:3:33:84 | testMemberFunction | testMemberFunction(int,java.lang.Object,java.lang.String,java.lang.Object) |
|
||||
| test.kt:30:1:42:1 | GenericTest | test.kt:33:3:33:84 | testMemberFunction | testMemberFunction(java.lang.Object,java.lang.Object) |
|
||||
| test.kt:30:1:42:1 | GenericTest | test.kt:33:3:33:84 | testMemberFunction$default | testMemberFunction$default(GenericTest,int,java.lang.Object,java.lang.String,java.lang.Object,int,java.lang.Object) |
|
||||
| test.kt:30:1:42:1 | GenericTest | test.kt:35:3:40:3 | useSpecialised | useSpecialised(GenericTest,GenericTest) |
|
||||
|
||||
@@ -1,21 +1,27 @@
|
||||
| User.java:9:30:9:37 | source(...) | test.kt:13:97:13:97 | s |
|
||||
| User.java:10:30:10:37 | source(...) | test.kt:13:97:13:97 | s |
|
||||
| User.java:14:37:14:44 | source(...) | test.kt:25:105:25:105 | s |
|
||||
| User.java:15:37:15:44 | source(...) | test.kt:25:105:25:105 | s |
|
||||
| User.java:19:28:19:35 | source(...) | test.kt:33:97:33:97 | s |
|
||||
| User.java:20:28:20:35 | source(...) | test.kt:33:97:33:97 | s |
|
||||
| User.java:24:28:24:35 | source(...) | test.kt:43:93:43:93 | s |
|
||||
| User.java:25:28:25:35 | source(...) | test.kt:43:93:43:93 | s |
|
||||
| User.java:29:45:29:52 | source(...) | test.kt:58:10:58:10 | s |
|
||||
| User.java:30:45:30:52 | source(...) | test.kt:58:10:58:10 | s |
|
||||
| User.java:34:61:34:68 | source(...) | test.kt:74:10:74:10 | s |
|
||||
| User.java:35:61:35:68 | source(...) | test.kt:74:10:74:10 | s |
|
||||
| User.java:38:28:38:35 | source(...) | test.kt:84:10:84:10 | y |
|
||||
| User.java:39:20:39:27 | source(...) | test.kt:84:10:84:10 | y |
|
||||
| test.kt:10:55:10:62 | source(...) | test.kt:10:84:10:84 | s |
|
||||
| test.kt:22:63:22:70 | source(...) | test.kt:22:92:22:92 | s |
|
||||
| test.kt:22:63:22:70 | source(...) | test.kt:22:92:22:92 | s |
|
||||
| test.kt:30:55:30:62 | source(...) | test.kt:30:84:30:84 | s |
|
||||
| test.kt:40:53:40:60 | source(...) | test.kt:40:80:40:80 | s |
|
||||
| test.kt:47:92:47:99 | source(...) | test.kt:50:10:50:10 | s |
|
||||
| test.kt:63:100:63:107 | source(...) | test.kt:66:10:66:10 | s |
|
||||
| User.java:9:30:9:37 | source(...) | test.kt:13:97:13:97 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:10:30:10:37 | source(...) | test.kt:13:97:13:97 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:14:37:14:44 | source(...) | test.kt:25:105:25:105 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:15:37:15:44 | source(...) | test.kt:25:105:25:105 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:19:28:19:35 | source(...) | test.kt:33:97:33:97 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:20:28:20:35 | source(...) | test.kt:33:97:33:97 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:24:28:24:35 | source(...) | test.kt:43:93:43:93 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:25:28:25:35 | source(...) | test.kt:43:93:43:93 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:29:45:29:52 | source(...) | test.kt:58:10:58:10 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:30:45:30:52 | source(...) | test.kt:58:10:58:10 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:34:61:34:68 | source(...) | test.kt:74:10:74:10 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:35:61:35:68 | source(...) | test.kt:74:10:74:10 | s | User.java:5:22:5:25 | test |
|
||||
| User.java:38:28:38:35 | source(...) | test.kt:84:10:84:10 | y | User.java:5:22:5:25 | test |
|
||||
| User.java:39:20:39:27 | source(...) | test.kt:84:10:84:10 | y | User.java:5:22:5:25 | test |
|
||||
| test.kt:10:55:10:62 | source(...) | test.kt:10:84:10:84 | s | test.kt:10:3:10:87 | taintSuppliedAsDefault |
|
||||
| test.kt:10:55:10:62 | source(...) | test.kt:10:84:10:84 | s | test.kt:10:3:10:87 | taintSuppliedAsDefault$default |
|
||||
| test.kt:22:63:22:70 | source(...) | test.kt:22:92:22:92 | s | test.kt:22:5:22:95 | taintSuppliedAsDefaultStatic |
|
||||
| test.kt:22:63:22:70 | source(...) | test.kt:22:92:22:92 | s | test.kt:22:5:22:95 | taintSuppliedAsDefaultStatic |
|
||||
| test.kt:22:63:22:70 | source(...) | test.kt:22:92:22:92 | s | test.kt:22:5:22:95 | taintSuppliedAsDefaultStatic$default |
|
||||
| test.kt:30:55:30:62 | source(...) | test.kt:30:84:30:84 | s | test.kt:30:3:30:87 | taintSuppliedAsDefault |
|
||||
| test.kt:30:55:30:62 | source(...) | test.kt:30:84:30:84 | s | test.kt:30:3:30:87 | taintSuppliedAsDefault$default |
|
||||
| test.kt:40:53:40:60 | source(...) | test.kt:40:80:40:80 | s | test.kt:40:3:40:83 | taintSuppliedAsDefault |
|
||||
| test.kt:40:53:40:60 | source(...) | test.kt:40:80:40:80 | s | test.kt:40:3:40:83 | taintSuppliedAsDefault$default |
|
||||
| test.kt:47:92:47:99 | source(...) | test.kt:50:10:50:10 | s | test.kt:47:55:53:1 | ConstructorTaintsByDefault |
|
||||
| test.kt:47:92:47:99 | source(...) | test.kt:50:10:50:10 | s | test.kt:47:55:53:1 | ConstructorTaintsByDefault |
|
||||
| test.kt:63:100:63:107 | source(...) | test.kt:66:10:66:10 | s | test.kt:63:65:69:1 | GenericConstructorTaintsByDefault |
|
||||
| test.kt:63:100:63:107 | source(...) | test.kt:66:10:66:10 | s | test.kt:63:65:69:1 | GenericConstructorTaintsByDefault |
|
||||
|
||||
@@ -15,4 +15,4 @@ class Config extends DataFlow::Configuration {
|
||||
|
||||
from Config c, DataFlow::Node source, DataFlow::Node sink
|
||||
where c.hasFlow(source, sink)
|
||||
select source, sink
|
||||
select source, sink, source.getEnclosingCallable()
|
||||
|
||||
@@ -12,27 +12,42 @@
|
||||
| clinit.kt:3:1:3:24 | int | TypeAccess |
|
||||
| clinit.kt:3:1:3:24 | int | TypeAccess |
|
||||
| clinit.kt:3:24:3:24 | 0 | IntegerLiteral |
|
||||
| dataClass.kt:0:0:0:0 | 0 | IntegerLiteral |
|
||||
| dataClass.kt:0:0:0:0 | 0 | IntegerLiteral |
|
||||
| dataClass.kt:0:0:0:0 | 1 | IntegerLiteral |
|
||||
| dataClass.kt:0:0:0:0 | 2 | IntegerLiteral |
|
||||
| dataClass.kt:0:0:0:0 | 31 | IntegerLiteral |
|
||||
| dataClass.kt:0:0:0:0 | "..." | StringTemplateExpr |
|
||||
| dataClass.kt:0:0:0:0 | (...)... | CastExpr |
|
||||
| dataClass.kt:0:0:0:0 | ) | StringLiteral |
|
||||
| dataClass.kt:0:0:0:0 | , | StringLiteral |
|
||||
| dataClass.kt:0:0:0:0 | ... !is ... | NotInstanceOfExpr |
|
||||
| dataClass.kt:0:0:0:0 | ... & ... | AndBitwiseExpr |
|
||||
| dataClass.kt:0:0:0:0 | ... & ... | AndBitwiseExpr |
|
||||
| dataClass.kt:0:0:0:0 | ... (value not-equals) ... | ValueNEExpr |
|
||||
| dataClass.kt:0:0:0:0 | ... (value not-equals) ... | ValueNEExpr |
|
||||
| dataClass.kt:0:0:0:0 | ... * ... | MulExpr |
|
||||
| dataClass.kt:0:0:0:0 | ... + ... | AddExpr |
|
||||
| dataClass.kt:0:0:0:0 | ... == ... | EQExpr |
|
||||
| dataClass.kt:0:0:0:0 | ... == ... | EQExpr |
|
||||
| dataClass.kt:0:0:0:0 | ... == ... | EQExpr |
|
||||
| dataClass.kt:0:0:0:0 | ...=... | AssignExpr |
|
||||
| dataClass.kt:0:0:0:0 | ...=... | AssignExpr |
|
||||
| dataClass.kt:0:0:0:0 | ...=... | AssignExpr |
|
||||
| dataClass.kt:0:0:0:0 | DataClass | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | DataClass | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | DataClass | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | DataClass | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | DataClass | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | DataClass | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | DataClass( | StringLiteral |
|
||||
| dataClass.kt:0:0:0:0 | Object | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | Object | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | String | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | String | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | String | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | boolean | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | copy(...) | MethodAccess |
|
||||
| dataClass.kt:0:0:0:0 | false | BooleanLiteral |
|
||||
| dataClass.kt:0:0:0:0 | false | BooleanLiteral |
|
||||
| dataClass.kt:0:0:0:0 | false | BooleanLiteral |
|
||||
@@ -40,10 +55,23 @@
|
||||
| dataClass.kt:0:0:0:0 | hashCode(...) | MethodAccess |
|
||||
| dataClass.kt:0:0:0:0 | int | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | int | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | int | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | int | TypeAccess |
|
||||
| dataClass.kt:0:0:0:0 | new DataClass(...) | ClassInstanceExpr |
|
||||
| dataClass.kt:0:0:0:0 | other | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | other | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | other | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p0 | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p0 | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p0 | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p0.x | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p0.y | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p1 | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p1 | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p2 | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p2 | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p3 | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | p3 | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | result | LocalVariableDeclExpr |
|
||||
| dataClass.kt:0:0:0:0 | result | VarAccess |
|
||||
| dataClass.kt:0:0:0:0 | result | VarAccess |
|
||||
|
||||
@@ -5,6 +5,7 @@ methods
|
||||
| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | component1 | component1() | public | Compiler generated |
|
||||
| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | component2 | component2() | public | Compiler generated |
|
||||
| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | copy | copy(int,java.lang.String) | public | Compiler generated |
|
||||
| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | copy$default | copy$default(DataClass,int,java.lang.String,int,java.lang.Object) | public, static | Compiler generated |
|
||||
| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | equals | equals(java.lang.Object) | override, public | Compiler generated |
|
||||
| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | hashCode | hashCode() | override, public | Compiler generated |
|
||||
| dataClass.kt:1:1:1:47 | DataClass | dataClass.kt:0:0:0:0 | toString | toString() | override, public | Compiler generated |
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
| clinit.kt:3:1:3:24 | setTopLevelInt | clinit.kt:3:1:3:24 | <set-?> | 0 |
|
||||
| dataClass.kt:0:0:0:0 | copy | dataClass.kt:1:22:1:31 | x | 0 |
|
||||
| dataClass.kt:0:0:0:0 | copy | dataClass.kt:1:34:1:46 | y | 1 |
|
||||
| dataClass.kt:0:0:0:0 | copy$default | dataClass.kt:0:0:0:0 | p0 | 0 |
|
||||
| dataClass.kt:0:0:0:0 | copy$default | dataClass.kt:0:0:0:0 | p1 | 1 |
|
||||
| dataClass.kt:0:0:0:0 | copy$default | dataClass.kt:0:0:0:0 | p2 | 2 |
|
||||
| dataClass.kt:0:0:0:0 | copy$default | dataClass.kt:0:0:0:0 | p3 | 3 |
|
||||
| dataClass.kt:0:0:0:0 | copy$default | dataClass.kt:0:0:0:0 | p4 | 4 |
|
||||
| dataClass.kt:0:0:0:0 | equals | dataClass.kt:0:0:0:0 | other | 0 |
|
||||
| dataClass.kt:1:34:1:46 | setY | dataClass.kt:1:34:1:46 | <set-?> | 0 |
|
||||
| delegates.kt:4:18:6:5 | get | delegates.kt:4:18:6:5 | a0 | 0 |
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
| PropertyReferenceDelegatesKt | getValue(KProperty0<? extends V>, Object, KProperty<?>) |
|
||||
| PropertyReferenceDelegatesKt | getValue(KProperty1<T,? extends V>, T, KProperty<?>) |
|
||||
| StringsKt | removePrefix(String, CharSequence) |
|
||||
| StringsKt | startsWith(String, String, boolean) |
|
||||
| StringsKt | startsWith$default(String, String, boolean, int, Object) |
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1 @@
|
||||
semmle/code/java/PrintAst.ql
|
||||
@@ -0,0 +1,13 @@
|
||||
import java
|
||||
|
||||
// This checks that all type parameter references are erased in the context of a $default function.
|
||||
predicate containsTypeVariables(Type t) {
|
||||
t != t.getErasure() and
|
||||
not t.getErasure().(GenericType).getRawType() = t
|
||||
}
|
||||
|
||||
from Expr e
|
||||
where
|
||||
e.getEnclosingCallable().getName().matches("%$default") and
|
||||
containsTypeVariables(e.getType())
|
||||
select e, e.getType()
|
||||
@@ -0,0 +1,2 @@
|
||||
shouldBeSunkButIsnt
|
||||
shouldntBeSunkButIs
|
||||
@@ -0,0 +1,34 @@
|
||||
import java
|
||||
import semmle.code.java.dataflow.DataFlow
|
||||
|
||||
class ShouldNotBeSunk extends StringLiteral {
|
||||
ShouldNotBeSunk() { this.getValue().matches("%not sunk%") }
|
||||
}
|
||||
|
||||
class ShouldBeSunk extends StringLiteral {
|
||||
ShouldBeSunk() {
|
||||
this.getValue().matches("%sunk%") and
|
||||
not this instanceof ShouldNotBeSunk
|
||||
}
|
||||
}
|
||||
|
||||
class Config extends DataFlow::Configuration {
|
||||
Config() { this = "Config" }
|
||||
|
||||
override predicate isSource(DataFlow::Node n) {
|
||||
n.asExpr() instanceof ShouldBeSunk or
|
||||
n.asExpr() instanceof ShouldNotBeSunk
|
||||
}
|
||||
|
||||
override predicate isSink(DataFlow::Node n) {
|
||||
n.asExpr().(Argument).getCall().getCallee().getName() = "sink"
|
||||
}
|
||||
}
|
||||
|
||||
predicate isSunk(StringLiteral sl) {
|
||||
exists(Config c, DataFlow::Node source | c.hasFlow(source, _) and sl = source.asExpr())
|
||||
}
|
||||
|
||||
query predicate shouldBeSunkButIsnt(ShouldBeSunk src) { not isSunk(src) }
|
||||
|
||||
query predicate shouldntBeSunkButIs(ShouldNotBeSunk src) { isSunk(src) }
|
||||
163
java/ql/test/kotlin/library-tests/parameter-defaults/test.kt
Normal file
163
java/ql/test/kotlin/library-tests/parameter-defaults/test.kt
Normal file
@@ -0,0 +1,163 @@
|
||||
fun sink(a: Any?) { }
|
||||
|
||||
class TestMember {
|
||||
|
||||
fun f(x: String, y: String = x, z: String = "hello world") {
|
||||
sink(y)
|
||||
}
|
||||
|
||||
fun user() {
|
||||
f("member sunk")
|
||||
f("member sunk fp", "member sunk 2")
|
||||
f("not sunk", "member sunk 3", "not sunk")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TestExtensionMember {
|
||||
|
||||
fun String.f(x: String, y: String = x, z: String = "hello world") {
|
||||
sink(this)
|
||||
sink(y)
|
||||
}
|
||||
|
||||
fun user(sunk: String) {
|
||||
sunk.f("extension sunk")
|
||||
sunk.f("extension sunk fp", "extension sunk 2")
|
||||
sunk.f("not sunk", "extension sunk 3", "not sunk")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
object TestStaticMember {
|
||||
|
||||
@JvmStatic fun f(x: String, y: String = x, z: String = "hello world") {
|
||||
sink(y)
|
||||
}
|
||||
|
||||
fun user() {
|
||||
f("static sunk")
|
||||
f("static sunk fp", "static sunk 2")
|
||||
f("not sunk", "static sunk 3", "not sunk")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class ExtendMe {
|
||||
|
||||
fun f(x: String) = x
|
||||
|
||||
}
|
||||
|
||||
class TestReceiverReferences {
|
||||
|
||||
fun g(x: String) = x
|
||||
|
||||
fun ExtendMe.test(x: String, y: String = this.f(this@TestReceiverReferences.g(x)), z: String = "hello world") {
|
||||
sink(y)
|
||||
}
|
||||
|
||||
fun user(t: ExtendMe) {
|
||||
t.test("receiver refs sunk")
|
||||
t.test("receiver refs sunk fp", "receiver refs sunk 2")
|
||||
t.test("not sunk", "receiver refs sunk 3", "not sunk")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TestConstructor(x: String, y: String = x, z: String = "hello world") {
|
||||
|
||||
init {
|
||||
sink(y)
|
||||
}
|
||||
|
||||
fun user() {
|
||||
TestConstructor("constructor sunk")
|
||||
TestConstructor("constructor sunk fp", "constructor sunk 2")
|
||||
TestConstructor("not sunk", "constructor sunk 3", "not sunk")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TestLocal {
|
||||
|
||||
fun enclosing() {
|
||||
|
||||
fun f(x: String, y: String = x, z: String = "hello world") {
|
||||
sink(y)
|
||||
}
|
||||
|
||||
fun user() {
|
||||
f("local sunk")
|
||||
f("local sunk fp", "local sunk 2")
|
||||
f("not sunk", "local sunk 3", "not sunk")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TestLocalClass {
|
||||
|
||||
fun enclosingFunction() {
|
||||
|
||||
class EnclosingLocalClass {
|
||||
|
||||
fun f(x: String, y: String = x, z: String = "hello world") {
|
||||
sink(y)
|
||||
}
|
||||
|
||||
fun user() {
|
||||
f("local sunk")
|
||||
f("local sunk fp", "local sunk 2")
|
||||
f("not sunk", "local sunk 3", "not sunk")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TestGeneric<T> {
|
||||
|
||||
fun f(x: T, y: T = x, z: T? = null) {
|
||||
sink(y)
|
||||
}
|
||||
|
||||
fun user(tgs: TestGeneric<String>, tcs: TestGeneric<CharSequence>) {
|
||||
tgs.f("generic sunk")
|
||||
tcs.f("generic sunk fp", "generic sunk 2")
|
||||
tgs.f("not sunk", "generic sunk 3", "not sunk")
|
||||
tcs.f("not sunk", "generic sunk 3", "not sunk")
|
||||
}
|
||||
|
||||
fun testReturn(t1: T, t2: T? = null) = t1
|
||||
|
||||
fun testReturnUser(tgs: TestGeneric<String>) {
|
||||
sink(tgs.testReturn("sunk return value"))
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class TestGenericFunction<T> {
|
||||
|
||||
fun <S : T> f(x: S, y: T = x, def1: T? = null, def2: List<T> = listOf(y), def3: S? = null, def4: List<S>? = listOf(x)) {
|
||||
sink(y)
|
||||
}
|
||||
|
||||
fun user(inst: TestGenericFunction<String>) {
|
||||
inst.f<String>("generic function sunk")
|
||||
inst.f("generic function sunk fp", "generic function sunk 2")
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
class VisibilityTests {
|
||||
|
||||
fun f(x: Int, y: Int = 0) = x + y
|
||||
internal fun g(x: Int, y: Int = 0) = x + y
|
||||
protected fun h(x: Int, y: Int = 0) = x + y
|
||||
private fun i(x: Int, y: Int = 0) = x + y
|
||||
|
||||
}
|
||||
@@ -233,6 +233,7 @@ compGenerated
|
||||
| file://<external>/Class2.class:0:0:0:0 | getValue | 3 |
|
||||
| file://<external>/Class2.class:0:0:0:0 | getValue | 3 |
|
||||
| file://<external>/KTypeProjection.class:0:0:0:0 | contravariant | 8 |
|
||||
| file://<external>/KTypeProjection.class:0:0:0:0 | copy$default | 10 |
|
||||
| file://<external>/KTypeProjection.class:0:0:0:0 | covariant | 8 |
|
||||
| file://<external>/KTypeProjection.class:0:0:0:0 | invariant | 8 |
|
||||
| reflection.kt:33:9:33:23 | getP0 | 3 |
|
||||
|
||||
Reference in New Issue
Block a user