From f3531914f087c8280f59512ced1dc65fe1372721 Mon Sep 17 00:00:00 2001 From: Volker Berlin Date: Sun, 14 Feb 2021 19:16:20 +0100 Subject: [PATCH] fix binary coding of types in table section --- .../jwebassembly/binary/BinaryModuleWriter.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/de/inetsoftware/jwebassembly/binary/BinaryModuleWriter.java b/src/de/inetsoftware/jwebassembly/binary/BinaryModuleWriter.java index 75509fe..4d8973b 100644 --- a/src/de/inetsoftware/jwebassembly/binary/BinaryModuleWriter.java +++ b/src/de/inetsoftware/jwebassembly/binary/BinaryModuleWriter.java @@ -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 }