mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-25 07:27:52 +01:00
fix binary coding of types in table section
This commit is contained in:
parent
945c245802
commit
f3531914f0
@ -192,21 +192,21 @@ public class BinaryModuleWriter extends ModuleWriter implements InstructionOpcod
|
|||||||
|
|
||||||
// indirect function table
|
// indirect function table
|
||||||
int elemCount = callIndirect ? imports.size() + functions.size() : 0;
|
int elemCount = callIndirect ? imports.size() + functions.size() : 0;
|
||||||
stream.writeValueType( ValueType.funcref ); // the type of elements
|
stream.writeRefValueType( ValueType.funcref ); // the type of elements
|
||||||
stream.writeVaruint32( 0 ); // flags; 1-maximum is available, 0-no maximum value available
|
stream.writeVaruint32( 0 ); // flags; 1-maximum is available, 0-no maximum value available
|
||||||
stream.writeVaruint32( elemCount ); // initial length
|
stream.writeVaruint32( elemCount ); // initial length
|
||||||
//stream.writeVaruint32( elemCount ); // maximum length
|
//stream.writeVaruint32( elemCount ); // maximum length
|
||||||
|
|
||||||
// string constants table
|
// string constants table
|
||||||
if( count >= 2 ) {
|
if( count >= 2 ) {
|
||||||
stream.writeValueType( stringType != null ? stringType : ValueType.externref ); // the type of elements
|
stream.writeRefValueType( stringType != null ? stringType : ValueType.externref ); // the type of elements
|
||||||
stream.writeVaruint32( 0 ); // flags; 1-maximum is available, 0-no maximum value available
|
stream.writeVaruint32( 0 ); // flags; 1-maximum is available, 0-no maximum value available
|
||||||
stream.writeVaruint32( stringCount ); // initial length
|
stream.writeVaruint32( stringCount ); // initial length
|
||||||
}
|
}
|
||||||
|
|
||||||
// table with classes
|
// table with classes
|
||||||
if( count >= 3 ) {
|
if( count >= 3 ) {
|
||||||
stream.writeValueType( classType != null ? classType : ValueType.externref ); // the type of elements
|
stream.writeRefValueType( classType != null ? classType : ValueType.externref ); // the type of elements
|
||||||
stream.writeVaruint32( 0 ); // flags; 1-maximum is available, 0-no maximum value available
|
stream.writeVaruint32( 0 ); // flags; 1-maximum is available, 0-no maximum value available
|
||||||
stream.writeVaruint32( typeCount ); // initial length
|
stream.writeVaruint32( typeCount ); // initial length
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user