From 9c33ef686b947b64a04d82a15ea33fb56723e735 Mon Sep 17 00:00:00 2001 From: Alexey Andreev Date: Mon, 17 Oct 2016 21:53:09 +0300 Subject: [PATCH] WASM: fix support of 0xC binary version --- .../org/teavm/backend/wasm/render/WasmBinaryRenderer.java | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/core/src/main/java/org/teavm/backend/wasm/render/WasmBinaryRenderer.java b/core/src/main/java/org/teavm/backend/wasm/render/WasmBinaryRenderer.java index 41684c01f..ebc356848 100644 --- a/core/src/main/java/org/teavm/backend/wasm/render/WasmBinaryRenderer.java +++ b/core/src/main/java/org/teavm/backend/wasm/render/WasmBinaryRenderer.java @@ -186,8 +186,7 @@ public class WasmBinaryRenderer { } else { section.writeByte(1); section.writeByte(0x20); - section.writeByte(3); - section.writeLEB(functionIndexes.size()); + section.writeByte(0); section.writeLEB(functionIndexes.size()); } writeSection(SECTION_TABLE, "table", section.getData()); @@ -198,7 +197,7 @@ public class WasmBinaryRenderer { if (version == WasmBinaryVersion.V_0xC) { section.writeByte(1); - section.writeByte(3); + section.writeByte(1); } section.writeLEB(module.getMemorySize()); section.writeLEB(module.getMemorySize());