mirror of
https://github.com/github/codeql.git
synced 2025-12-20 18:56:32 +01:00
* Extract varargs as if they are ordinary positional arguments * Adapt the QL that distinguishes varargs from ordinary arguments to account for Kotlin's varargs which can occur in the middle of the arg list * Add a test checking dataflow through varargs which doesn't work yet due to array-get and array-set not being extracted as IndexExprs * Extract the special case arrayOf(*x) as a clone call, which is (equivalent to) the Java lowering of that operation
21 lines
426 B
Plaintext
21 lines
426 B
Plaintext
import java
|
|
|
|
query predicate varargsParams(Parameter p, Type t) {
|
|
p.getCallable().fromSource() and
|
|
p.isVarargs() and
|
|
t = p.getType()
|
|
}
|
|
|
|
query predicate explicitVarargsArguments(Argument a, Call c) {
|
|
a.isExplicitVarargsArray() and
|
|
a.getCall() = c
|
|
}
|
|
|
|
query predicate implicitVarargsArguments(Argument a, Call c, int pos) {
|
|
a.isNthVararg(pos) and
|
|
a.getCall() = c
|
|
}
|
|
|
|
from Call c, int i
|
|
select c, i, c.getArgument(i)
|