summaryrefslogtreecommitdiff
path: root/src/wasm
diff options
context:
space:
mode:
authorAlon Zakai <azakai@google.com>2022-06-16 17:42:35 -0700
committerGitHub <noreply@github.com>2022-06-17 00:42:35 +0000
commit4652398b62ce0546f015cdc2c7b3010938c7c5a9 (patch)
tree3abe503a08640c621c98ab8838f972ab03fd862b /src/wasm
parent4a4c9eb87a5e26a86c048529ae19c1f539f949d7 (diff)
downloadbinaryen-4652398b62ce0546f015cdc2c7b3010938c7c5a9.tar.gz
binaryen-4652398b62ce0546f015cdc2c7b3010938c7c5a9.tar.bz2
binaryen-4652398b62ce0546f015cdc2c7b3010938c7c5a9.zip
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
Diffstat (limited to 'src/wasm')
-rw-r--r--src/wasm/wasm-binary.cpp3
1 files changed, 2 insertions, 1 deletions
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: