[Wasm] Always use -0x30/sub when defining a struct type
Otherwise, according to the spec, a type will be treated as a final, which is not correct in many cases. Later, we can generate final struct types when it's applicable. #KT-60200 Fixed
This commit is contained in:
@@ -320,12 +320,16 @@ class WasmIrToBinary(
|
|||||||
}
|
}
|
||||||
|
|
||||||
private fun appendStructTypeDeclaration(type: WasmStructDeclaration) {
|
private fun appendStructTypeDeclaration(type: WasmStructDeclaration) {
|
||||||
|
b.writeVarInt7(-0x30)
|
||||||
|
|
||||||
val superType = type.superType
|
val superType = type.superType
|
||||||
if (superType != null) {
|
if (superType != null) {
|
||||||
b.writeVarInt7(-0x30)
|
|
||||||
appendVectorSize(1)
|
appendVectorSize(1)
|
||||||
appendModuleFieldReference(superType.owner)
|
appendModuleFieldReference(superType.owner)
|
||||||
|
} else {
|
||||||
|
appendVectorSize(0)
|
||||||
}
|
}
|
||||||
|
|
||||||
b.writeVarInt7(-0x21)
|
b.writeVarInt7(-0x21)
|
||||||
b.writeVarUInt32(type.fields.size)
|
b.writeVarUInt32(type.fields.size)
|
||||||
type.fields.forEach {
|
type.fields.forEach {
|
||||||
|
|||||||
Reference in New Issue
Block a user