summaryrefslogtreecommitdiff
path: root/src/wasm-linker.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-linker.cpp')
-rw-r--r--src/wasm-linker.cpp2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/wasm-linker.cpp b/src/wasm-linker.cpp
index 80374c1e4..6e3eae1fb 100644
--- a/src/wasm-linker.cpp
+++ b/src/wasm-linker.cpp
@@ -122,6 +122,7 @@ void Linker::layout() {
// Pad the indirect function table with a dummy function
makeDummyFunction();
+ ensureTableIsPopulated();
// Pre-assign the function indexes
for (auto& pair : out.indirectIndexes) {
@@ -359,6 +360,7 @@ void Linker::makeDummyFunction() {
break;
}
}
+
if (!create) return;
wasm::Builder wasmBuilder(out.wasm);
Expression *unreachable = wasmBuilder.makeUnreachable();