mirror of
https://github.com/github/codeql.git
synced 2025-12-22 11:46:32 +01:00
Only get existing local function labels
This commit is contained in:
@@ -1162,6 +1162,14 @@ open class KotlinUsesExtractor(
|
||||
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--
|
||||
// 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.
|
||||
|
||||
@@ -107,7 +107,7 @@ class CommentExtractor(private val fileExtractor: KotlinFileExtractor, private v
|
||||
tw.getExistingVariableLabelFor(ownerIr)
|
||||
} else if (ownerIr is IrFunction && ownerIr.isLocalFunction()) {
|
||||
label = "local function ${ownerIr.name.asString()}"
|
||||
fileExtractor.getLocallyVisibleFunctionLabels(ownerIr).function
|
||||
fileExtractor.getExistingLocallyVisibleFunctionLabel(ownerIr)
|
||||
}
|
||||
else {
|
||||
label = getLabel(ownerIr) ?: continue
|
||||
|
||||
Reference in New Issue
Block a user