From 4652398b62ce0546f015cdc2c7b3010938c7c5a9 Mon Sep 17 00:00:00 2001 From: Alon Zakai Date: Thu, 16 Jun 2022 17:42:35 -0700 Subject: Fix table exporting (#4736) This code was apparently not updated when we added multi-table support, and still had the old hardcoded index 0. Fixes #4711 --- src/wasm/wasm-binary.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/wasm/wasm-binary.cpp') diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp index decd78852..6cbf880e3 100644 --- a/src/wasm/wasm-binary.cpp +++ b/src/wasm/wasm-binary.cpp @@ -492,9 +492,10 @@ void WasmBinaryWriter::writeExports() { o << U32LEB(getFunctionIndex(curr->value)); break; case ExternalKind::Table: - o << U32LEB(0); + o << U32LEB(getTableIndex(curr->value)); break; case ExternalKind::Memory: + // TODO: fix with multi-memory o << U32LEB(0); break; case ExternalKind::Global: -- cgit v1.2.3