mirror of
https://github.com/github/codeql.git
synced 2025-12-19 10:23:15 +01:00
If we only look at the dispatch receiver, these show up like `this` references rather than `super` references, preventing flow through super-calls. The super-interface case requires properly noting that interface methods with a body get a `default` modifier in order to avoid QL discarding the method as a possible callee.
37 lines
378 B
Kotlin
37 lines
378 B
Kotlin
open class A {
|
|
|
|
open fun f(x: String) = x
|
|
|
|
}
|
|
|
|
interface B {
|
|
|
|
fun g(x: String) = x
|
|
|
|
}
|
|
|
|
interface C {
|
|
|
|
fun g(x: String) = x
|
|
|
|
}
|
|
|
|
class User : A(), B, C {
|
|
|
|
override fun f(x: String) = super.f(x)
|
|
|
|
override fun g(x: String) = super<B>.g(x)
|
|
|
|
fun source() = "tainted"
|
|
|
|
fun sink(s: String) { }
|
|
|
|
fun test() {
|
|
|
|
sink(this.f(source()))
|
|
sink(this.g(source()))
|
|
|
|
}
|
|
|
|
}
|