summaryrefslogtreecommitdiff
path: root/src/wasm-linker.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm-linker.h')
-rw-r--r--src/wasm-linker.h7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/wasm-linker.h b/src/wasm-linker.h
index ab336e581..f6cf832c7 100644
--- a/src/wasm-linker.h
+++ b/src/wasm-linker.h
@@ -103,6 +103,11 @@ class LinkerObject {
wasm.memory.segments.emplace_back(0, data, size);
}
+ void addSegment(Name name, std::vector<char>& data) {
+ segments[name] = wasm.memory.segments.size();
+ wasm.memory.segments.emplace_back(0, data);
+ }
+
void addInitializerFunction(Name name) {
initializerFunctions.emplace_back(name);
assert(symbolInfo.implementedFunctions.count(name));
@@ -246,7 +251,7 @@ class Linker {
return;
}
if (out.wasm.checkExport(name)) return; // Already exported
- auto exp = out.wasm.allocator.alloc<Export>();
+ auto exp = new Export;
exp->name = exp->value = name;
out.wasm.addExport(exp);
}