mirror of
https://github.com/github/codeql.git
synced 2026-04-28 02:05:14 +02:00
Adjust extraction to reuse KtProperty* relations
This commit is contained in:
@@ -897,21 +897,21 @@ open class KotlinFileExtractor(
|
||||
tw.writeHasLocation(blockId, locId)
|
||||
extractVariable(s.delegate, callable, blockId, 0)
|
||||
|
||||
val propType = useType(s.type)
|
||||
val propId = tw.getFreshIdLabel<DbKt_local_delegated_property>()
|
||||
tw.writeKtLocalDelegatedProperties(propId, useVariable(s.delegate), propType.javaResult.id, s.name.asString())
|
||||
tw.writeKtLocalDelegatedPropertiesKotlinType(propId, propType.kotlinResult.id)
|
||||
val propId = tw.getFreshIdLabel<DbKt_property>()
|
||||
tw.writeKtProperties(propId, s.name.asString())
|
||||
tw.writeHasLocation(propId, locId)
|
||||
tw.writeKtPropertyDelegates(propId, useVariable(s.delegate))
|
||||
|
||||
// Getter:
|
||||
extractStatement(s.getter, callable, blockId, 1)
|
||||
val l = getLocallyVisibleFunctionLabels(s.getter).function
|
||||
tw.writeKtLocalDelegatedPropertyGetters(propId, l)
|
||||
tw.writeKtPropertyGetters(propId, l)
|
||||
|
||||
val setter = s.setter
|
||||
if (setter != null) {
|
||||
extractStatement(setter, callable, blockId, 2)
|
||||
val l = getLocallyVisibleFunctionLabels(setter).function
|
||||
tw.writeKtLocalDelegatedPropertySetters(propId, l)
|
||||
tw.writeKtPropertySetters(propId, l)
|
||||
}
|
||||
}
|
||||
else -> {
|
||||
|
||||
@@ -1218,24 +1218,7 @@ ktInitializerAssignment(
|
||||
unique int id: @assignexpr ref
|
||||
)
|
||||
|
||||
ktLocalDelegatedProperties(
|
||||
unique int id: @kt_local_delegated_property,
|
||||
unique int variableId: @variable ref,
|
||||
int typeId: @type ref,
|
||||
string name: string ref
|
||||
)
|
||||
|
||||
ktLocalDelegatedPropertiesKotlinType(
|
||||
unique int id: @kt_local_delegated_property ref,
|
||||
int kttypeid: @kt_type ref
|
||||
);
|
||||
|
||||
ktLocalDelegatedPropertyGetters(
|
||||
unique int id: @kt_local_delegated_property ref,
|
||||
int getter: @method ref
|
||||
)
|
||||
|
||||
ktLocalDelegatedPropertySetters(
|
||||
unique int id: @kt_local_delegated_property ref,
|
||||
int setter: @method ref
|
||||
ktPropertyDelegates(
|
||||
unique int id: @kt_property ref,
|
||||
unique int variableId: @variable ref
|
||||
)
|
||||
|
||||
Reference in New Issue
Block a user