mirror of
https://github.com/github/codeql.git
synced 2025-12-19 18:33:16 +01:00
Merge pull request #10313 from tamasvajk/kotlin-fix-vararg
Kotlin: Fix `vararg` extraction outside of method call
This commit is contained in:
@@ -3105,7 +3105,13 @@ open class KotlinFileExtractor(
|
||||
extractTypeOperatorCall(e, callable, exprParent.parent, exprParent.idx, exprParent.enclosingStmt)
|
||||
}
|
||||
is IrVararg -> {
|
||||
logger.errorElement("Unexpected IrVararg", e)
|
||||
if (e.elements.size != 1 || e.elements[0] !is IrSpreadElement) {
|
||||
logger.errorElement("Unexpected IrVararg", e)
|
||||
return
|
||||
}
|
||||
// There are lowered IR cases when the vararg expression is not within a call, such as
|
||||
// val temp0 = [*expr]
|
||||
extractExpression((e.elements[0] as IrSpreadElement).expression, callable, parent)
|
||||
}
|
||||
is IrGetObjectValue -> {
|
||||
// For `object MyObject { ... }`, the .class has an
|
||||
|
||||
Reference in New Issue
Block a user