summaryrefslogtreecommitdiff
path: root/src/passes/PostEmscripten.cpp
diff options
context:
space:
mode:
authorAbbas Mashayekh <martianboy2005@gmail.com>2021-02-10 01:17:28 +0330
committerGitHub <noreply@github.com>2021-02-09 13:47:28 -0800
commit3da8b08ecd57f5662bebc69ea73bf59e1928341e (patch)
tree2902eedc161579eaf37a1aed463de95916eee703 /src/passes/PostEmscripten.cpp
parenta12a8250da24aa5b5787bf89562b243fdc514302 (diff)
downloadbinaryen-3da8b08ecd57f5662bebc69ea73bf59e1928341e.tar.gz
binaryen-3da8b08ecd57f5662bebc69ea73bf59e1928341e.tar.bz2
binaryen-3da8b08ecd57f5662bebc69ea73bf59e1928341e.zip
[reference-types] remove single table restriction in IR (#3517)
Adds support for modules with multiple tables. Adds a field for the table name to `CallIndirect` and updates the C/JS APIs accordingly.
Diffstat (limited to 'src/passes/PostEmscripten.cpp')
-rw-r--r--src/passes/PostEmscripten.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/passes/PostEmscripten.cpp b/src/passes/PostEmscripten.cpp
index d57d849da..35e2b9a8b 100644
--- a/src/passes/PostEmscripten.cpp
+++ b/src/passes/PostEmscripten.cpp
@@ -61,13 +61,13 @@ struct PostEmscripten : public Pass {
hasInvokes = true;
}
}
- if (!hasInvokes) {
+ if (!hasInvokes || module->tables.empty()) {
return;
}
// Next, see if the Table is flat, which we need in order to see where
// invokes go statically. (In dynamic linking, the table is not flat,
// and we can't do this.)
- TableUtils::FlatTable flatTable(module->table);
+ TableUtils::FlatTable flatTable(*module->tables[0]);
if (!flatTable.valid) {
return;
}