mirror of
https://github.com/i-net-software/JWebAssembly.git
synced 2025-03-15 02:44:47 +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
|
||||
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( elemCount ); // initial length
|
||||
//stream.writeVaruint32( elemCount ); // maximum length
|
||||
|
||||
// string constants table
|
||||
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( stringCount ); // initial length
|
||||
}
|
||||
|
||||
// table with classes
|
||||
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( typeCount ); // initial length
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user