Fixed bug in DFG layout hash computation
This commit is contained in:
+8
-6
@@ -22,7 +22,7 @@ import org.jetbrains.kotlin.backend.konan.PrimitiveBinaryType
|
|||||||
import org.jetbrains.kotlin.config.CommonConfigurationKeys
|
import org.jetbrains.kotlin.config.CommonConfigurationKeys
|
||||||
import sun.misc.Unsafe
|
import sun.misc.Unsafe
|
||||||
import kotlin.reflect.KClass
|
import kotlin.reflect.KClass
|
||||||
import kotlin.reflect.full.primaryConstructor
|
import kotlin.reflect.full.memberProperties
|
||||||
import kotlin.reflect.jvm.jvmName
|
import kotlin.reflect.jvm.jvmName
|
||||||
|
|
||||||
internal class ExternalModulesDFG(val allTypes: List<DataFlowIR.Type.Declared>,
|
internal class ExternalModulesDFG(val allTypes: List<DataFlowIR.Type.Declared>,
|
||||||
@@ -760,14 +760,16 @@ internal object DFGSerializer {
|
|||||||
}
|
}
|
||||||
if (kClass.java.isArray)
|
if (kClass.java.isArray)
|
||||||
return mergeHashes("array".hash, computeDataLayoutHash(kClass.java.componentType.kotlin))
|
return mergeHashes("array".hash, computeDataLayoutHash(kClass.java.componentType.kotlin))
|
||||||
val propertiesHashes = kClass.primaryConstructor!!.parameters
|
val properties = kClass.memberProperties.sortedBy { it.name }
|
||||||
.map {
|
val propertyTypeHashes =
|
||||||
val propHash = computeDataLayoutHash(it.type.classifier!! as KClass<*>)
|
properties.map {
|
||||||
if (it.type.isMarkedNullable)
|
val propHash = computeDataLayoutHash(it.returnType.classifier!! as KClass<*>)
|
||||||
|
if (it.returnType.isMarkedNullable)
|
||||||
mergeHashes("nullable".hash, propHash)
|
mergeHashes("nullable".hash, propHash)
|
||||||
else propHash
|
else propHash
|
||||||
}
|
}
|
||||||
return mergeHashes(propertiesHashes)
|
val propertyNameHashes = properties.map { it.name.hash }
|
||||||
|
return mergeHashes(propertyTypeHashes + propertyNameHashes)
|
||||||
}
|
}
|
||||||
|
|
||||||
private val DEBUG = 0
|
private val DEBUG = 0
|
||||||
|
|||||||
Reference in New Issue
Block a user