mirror of
https://github.com/github/codeql.git
synced 2025-12-24 04:36:35 +01:00
Only get existing local function labels
This commit is contained in:
@@ -1162,6 +1162,14 @@ open class KotlinUsesExtractor(
|
|||||||
return res
|
return res
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fun getExistingLocallyVisibleFunctionLabel(f: IrFunction): Label<DbMethod>? {
|
||||||
|
if (!f.isLocalFunction()){
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
return tw.lm.locallyVisibleFunctionLabelMapping[f]?.function
|
||||||
|
}
|
||||||
|
|
||||||
// These are classes with Java equivalents, but whose methods don't all exist on those Java equivalents--
|
// These are classes with Java equivalents, but whose methods don't all exist on those Java equivalents--
|
||||||
// for example, the numeric classes define arithmetic functions (Int.plus, Long.or and so on) that lower to
|
// for example, the numeric classes define arithmetic functions (Int.plus, Long.or and so on) that lower to
|
||||||
// primitive arithmetic on the JVM, but which we extract as calls to reflect the source syntax more closely.
|
// primitive arithmetic on the JVM, but which we extract as calls to reflect the source syntax more closely.
|
||||||
|
|||||||
@@ -107,7 +107,7 @@ class CommentExtractor(private val fileExtractor: KotlinFileExtractor, private v
|
|||||||
tw.getExistingVariableLabelFor(ownerIr)
|
tw.getExistingVariableLabelFor(ownerIr)
|
||||||
} else if (ownerIr is IrFunction && ownerIr.isLocalFunction()) {
|
} else if (ownerIr is IrFunction && ownerIr.isLocalFunction()) {
|
||||||
label = "local function ${ownerIr.name.asString()}"
|
label = "local function ${ownerIr.name.asString()}"
|
||||||
fileExtractor.getLocallyVisibleFunctionLabels(ownerIr).function
|
fileExtractor.getExistingLocallyVisibleFunctionLabel(ownerIr)
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
label = getLabel(ownerIr) ?: continue
|
label = getLabel(ownerIr) ?: continue
|
||||||
|
|||||||
Reference in New Issue
Block a user