mirror of
https://github.com/github/codeql.git
synced 2025-12-22 19:56:32 +01:00
Always extract static initializers if a class has static members
This may not be necessary for anonymous objects, but it is certainly unrelated to `init { ... }` blocks.
This commit is contained in:
committed by
Ian Lynagh
parent
e21a60bb4b
commit
375199508e
@@ -98,8 +98,7 @@ open class KotlinFileExtractor(
|
||||
if (isExternalDeclaration(declaration)) {
|
||||
extractExternalClassLater(declaration)
|
||||
} else {
|
||||
val extractStaticInit = declaration.declarations.none { it is IrAnonymousInitializer }
|
||||
extractClassSource(declaration, true, extractStaticInit)
|
||||
extractClassSource(declaration, extractDeclarations = true, extractStaticInitializer = true)
|
||||
}
|
||||
}
|
||||
is IrFunction -> {
|
||||
@@ -350,8 +349,7 @@ open class KotlinFileExtractor(
|
||||
}
|
||||
|
||||
private fun extractLocalTypeDeclStmt(c: IrClass, callable: Label<out DbCallable>, parent: Label<out DbStmtparent>, idx: Int) {
|
||||
val extractStaticInit = c.declarations.none { it is IrAnonymousInitializer }
|
||||
val id = extractClassSource(c, true, extractStaticInit).cast<DbClass>()
|
||||
val id = extractClassSource(c, extractDeclarations = true, extractStaticInitializer = true).cast<DbClass>()
|
||||
extractLocalTypeDeclStmt(id, c, callable, parent, idx)
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user