Change mangling for local functions
This commit is contained in:
committed by
Yan Zhulanow
parent
aca3be12e9
commit
488418d960
@@ -265,9 +265,8 @@ class VariableFinder private constructor(private val context: EvaluationContextI
|
||||
val canBeLocalFunction = kind is VariableKind.Ordinary
|
||||
|
||||
if (canBeLocalFunction && kind.type?.isFunctionType() == true) {
|
||||
@Suppress("ConvertToStringTemplate")
|
||||
variables.namedEntitySequence()
|
||||
.filter { it.name == name + "$" && kind.typeMatches(it.type) }
|
||||
.filter { isLocalFunctionName(it.name, name) && kind.typeMatches(it.type) }
|
||||
.firstOrNull()
|
||||
?.let { return Result(it.value()) }
|
||||
}
|
||||
@@ -291,6 +290,11 @@ class VariableFinder private constructor(private val context: EvaluationContextI
|
||||
return null
|
||||
}
|
||||
|
||||
private fun isLocalFunctionName(name: String, functionName: String): Boolean {
|
||||
@Suppress("ConvertToStringTemplate")
|
||||
return name == functionName + "$" || name.startsWith(AsmUtil.LOCAL_FUNCTION_VARIABLE_PREFIX + name + "$")
|
||||
}
|
||||
|
||||
private fun findCoroutineContext(): ObjectReference? {
|
||||
val method = frameProxy.location().safeMethod() ?: return null
|
||||
return findCoroutineContextForLambda(method) ?: findCoroutineContextForMethod(method)
|
||||
|
||||
Reference in New Issue
Block a user