diff options
Diffstat (limited to 'src/wasm-linker.h')
-rw-r--r-- | src/wasm-linker.h | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/wasm-linker.h b/src/wasm-linker.h index 3f1e8c7ac..a6f5d319a 100644 --- a/src/wasm-linker.h +++ b/src/wasm-linker.h @@ -114,12 +114,12 @@ class LinkerObject { // Add an initializer segment for the named static variable. void addSegment(Name name, const char* data, Address size) { segments[name] = wasm.memory.segments.size(); - wasm.memory.segments.emplace_back(0, data, size); + wasm.memory.segments.emplace_back(wasm.allocator.alloc<Const>()->set(Literal(uint32_t(0))), data, size); } void addSegment(Name name, std::vector<char>& data) { segments[name] = wasm.memory.segments.size(); - wasm.memory.segments.emplace_back(0, data); + wasm.memory.segments.emplace_back(wasm.allocator.alloc<Const>()->set(Literal(uint32_t(0))), data); } void addInitializerFunction(Name name) { @@ -282,6 +282,10 @@ class Linker { void ensureImport(Name target, std::string signature); + // Makes sure the table has a single segment, with offset 0, + // to which we can add content. + Table::Segment& getTableSegment(); + // Retrieves (and assigns) an entry index in the indirect function table for // a given function. Index getFunctionIndex(Name name); |