mirror of
https://github.com/github/codeql.git
synced 2026-04-27 17:55:19 +02:00
Kotlin: Apply some review feedback
This commit is contained in:
@@ -4,8 +4,6 @@ import semmle.code.java.ControlFlowGraph
|
||||
predicate shouldBeDeadEnd(ControlFlowNode n) {
|
||||
n instanceof BreakStmt and n.getFile().isKotlinSourceFile() // TODO
|
||||
or
|
||||
n instanceof ReturnStmt and n.getFile().isKotlinSourceFile() // TODO
|
||||
or
|
||||
n instanceof Interface // TODO
|
||||
or
|
||||
n instanceof Class // TODO
|
||||
|
||||
@@ -46,8 +46,7 @@ predicate gapInChildren(Element e, int i) {
|
||||
|
||||
predicate lateFirstChild(Element e, int i) {
|
||||
i > 0 and
|
||||
exists(nthChildOf(e, i)) and
|
||||
forex(int j | exists(nthChildOf(e, j)) | j >= i) and
|
||||
i = min(int j | exists(nthChildOf(e, j))) and
|
||||
// A wildcard type access can be `?` with no children,
|
||||
// `? extends T` with only a child 0, or `? super T`
|
||||
// with only a child 1.
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
*/
|
||||
|
||||
import java
|
||||
import semmle.code.java.frameworks.android.Compose
|
||||
private import semmle.code.java.frameworks.android.Compose
|
||||
|
||||
/** A common super-class that represents all kinds of expressions. */
|
||||
class Expr extends ExprParent, @expr {
|
||||
@@ -2349,10 +2349,9 @@ class Argument extends Expr {
|
||||
*/
|
||||
predicate isNthVararg(int arrayindex) {
|
||||
not this.isExplicitVarargsArray() and
|
||||
exists(Callable tgt, Parameter varargsParam, int varargsParamPos |
|
||||
exists(Callable tgt, int varargsParamPos |
|
||||
call.getCallee() = tgt and
|
||||
tgt.getParameter(varargsParamPos) = varargsParam and
|
||||
varargsParam.isVarargs() and
|
||||
tgt.getParameter(varargsParamPos).isVarargs() and
|
||||
arrayindex = pos - varargsParamPos and
|
||||
arrayindex >= 0 and
|
||||
arrayindex <= (call.getNumArgument() - tgt.getNumberOfParameters())
|
||||
|
||||
@@ -9,8 +9,6 @@ import java
|
||||
* This always returns a constant expression and can be considered as such.
|
||||
*/
|
||||
class LiveLiteral extends MethodAccess {
|
||||
CompileTimeConstantExpr value;
|
||||
|
||||
LiveLiteral() {
|
||||
this.getMethod() instanceof LiveLiteralMethod and
|
||||
not this.getEnclosingCallable() instanceof LiveLiteralMethod
|
||||
|
||||
Reference in New Issue
Block a user