summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/passes/Print.cpp2
-rw-r--r--src/wasm-linker.cpp2
2 files changed, 4 insertions, 0 deletions
diff --git a/src/passes/Print.cpp b/src/passes/Print.cpp
index 572732275..275d52888 100644
--- a/src/passes/Print.cpp
+++ b/src/passes/Print.cpp
@@ -634,6 +634,8 @@ struct PrintSExpression : public Visitor<PrintSExpression> {
}
doIndent(o, indent);
for (auto& segment : curr->segments) {
+ // Don't print empty segments
+ if (segment.data.empty()) continue;
printOpening(o, "elem ", true);
visit(segment.offset);
for (auto name : segment.data) {
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();