Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1,256 changes: 1,256 additions & 0 deletions java/downgrades/ecfcf050952e54b1155fc89525db84af6ad34aaf/old.dbscheme

Large diffs are not rendered by default.

1,255 changes: 1,255 additions & 0 deletions java/downgrades/ecfcf050952e54b1155fc89525db84af6ad34aaf/semmlecode.dbscheme

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
description: Remove ENUM_ENTRIES
compatibility: full
16 changes: 10 additions & 6 deletions java/kotlin-extractor/src/main/kotlin/KotlinFileExtractor.kt
Original file line number Diff line number Diff line change
Expand Up @@ -1701,12 +1701,13 @@ open class KotlinFileExtractor(

private fun extractSyntheticBody(b: IrSyntheticBody, callable: Label<out DbCallable>) {
with("synthetic body", b) {
when (b.kind) {
IrSyntheticBodyKind.ENUM_VALUES -> tw.writeKtSyntheticBody(callable, 1)
IrSyntheticBodyKind.ENUM_VALUEOF -> tw.writeKtSyntheticBody(callable, 2)
val kind = b.kind
when {
kind == IrSyntheticBodyKind.ENUM_VALUES -> tw.writeKtSyntheticBody(callable, 1)
kind == IrSyntheticBodyKind.ENUM_VALUEOF -> tw.writeKtSyntheticBody(callable, 2)
kind == kind_ENUM_ENTRIES -> tw.writeKtSyntheticBody(callable, 3)
else -> {
// TODO: Support IrSyntheticBodyKind.ENUM_ENTRIES
logger.errorElement("Unhandled synthetic body kind " + b.kind.javaClass, b)
logger.errorElement("Unhandled synthetic body kind " + kind, b)
}
}
}
Expand Down Expand Up @@ -5316,7 +5317,10 @@ open class KotlinFileExtractor(
private fun extractTypeAccessRecursive(t: IrType, location: Label<out DbLocation>, parent: Label<out DbExprparent>, idx: Int, typeContext: TypeContext = TypeContext.OTHER): Label<out DbExpr> {
val typeAccessId = extractTypeAccess(useType(t, typeContext), location, parent, idx)
if (t is IrSimpleType) {
t.arguments.forEachIndexed { argIdx, arg ->
// From 1.9, the list might change when we call erase,
// so we make a copy that it is safe to iterate over.
val argumentsCopy = t.arguments.toList()
argumentsCopy.forEachIndexed { argIdx, arg ->
extractWildcardTypeAccessRecursive(arg, location, typeAccessId, argIdx)
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.github.codeql.utils.versions

import org.jetbrains.kotlin.ir.expressions.IrSyntheticBodyKind

val kind_ENUM_ENTRIES: IrSyntheticBodyKind? = null

Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
package com.github.codeql.utils.versions

import org.jetbrains.kotlin.ir.expressions.IrSyntheticBodyKind

val kind_ENUM_ENTRIES: IrSyntheticBodyKind? = IrSyntheticBodyKind.ENUM_ENTRIES

1 change: 1 addition & 0 deletions java/ql/lib/config/semmlecode.dbscheme
Original file line number Diff line number Diff line change
Expand Up @@ -1219,6 +1219,7 @@ ktSyntheticBody(
int kind: int ref
// 1: ENUM_VALUES
// 2: ENUM_VALUEOF
// 3: ENUM_ENTRIES
)

ktLocalFunction(
Expand Down
Loading