mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Annotate generated static proxy methods as compiler-generated
This commit is contained in:
@@ -490,6 +490,7 @@ open class KotlinFileExtractor(
|
|||||||
// but suppress outputting the body, which we will replace with a delegating call below.
|
// but suppress outputting the body, which we will replace with a delegating call below.
|
||||||
forceExtractFunction(f, classId, extractBody = false, extractMethodAndParameterTypeAccesses = extractFunctionBodies, typeSubstitution = null, classTypeArgsIncludingOuterClasses = listOf(), idOverride = proxyFunctionId, locOverride = null)
|
forceExtractFunction(f, classId, extractBody = false, extractMethodAndParameterTypeAccesses = extractFunctionBodies, typeSubstitution = null, classTypeArgsIncludingOuterClasses = listOf(), idOverride = proxyFunctionId, locOverride = null)
|
||||||
addModifiers(proxyFunctionId, "static")
|
addModifiers(proxyFunctionId, "static")
|
||||||
|
tw.writeCompiler_generated(proxyFunctionId, CompilerGeneratedKinds.JVMSTATIC_PROXY_METHOD.kind)
|
||||||
if (extractFunctionBodies) {
|
if (extractFunctionBodies) {
|
||||||
val realFunctionLocId = tw.getLocation(f)
|
val realFunctionLocId = tw.getLocation(f)
|
||||||
extractExpressionBody(proxyFunctionId, realFunctionLocId).also { returnId ->
|
extractExpressionBody(proxyFunctionId, realFunctionLocId).also { returnId ->
|
||||||
@@ -4537,5 +4538,6 @@ open class KotlinFileExtractor(
|
|||||||
ENUM_CLASS_SPECIAL_MEMBER(5),
|
ENUM_CLASS_SPECIAL_MEMBER(5),
|
||||||
DELEGATED_PROPERTY_GETTER(6),
|
DELEGATED_PROPERTY_GETTER(6),
|
||||||
DELEGATED_PROPERTY_SETTER(7),
|
DELEGATED_PROPERTY_SETTER(7),
|
||||||
|
JVMSTATIC_PROXY_METHOD(8),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -57,6 +57,12 @@ class Element extends @element, Top {
|
|||||||
i = 4 and result = "Class initialisation method <clinit>"
|
i = 4 and result = "Class initialisation method <clinit>"
|
||||||
or
|
or
|
||||||
i = 5 and result = "Enum class special member"
|
i = 5 and result = "Enum class special member"
|
||||||
|
or
|
||||||
|
i = 6 and result = "Getter for a Kotlin delegated property"
|
||||||
|
or
|
||||||
|
i = 7 and result = "Setter for a Kotlin delegated property"
|
||||||
|
or
|
||||||
|
i = 8 and result = "Proxy static method for a @JvmStatic-annotated function or property"
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user