diff options
author | Alon Zakai <alonzakai@gmail.com> | 2016-08-16 09:40:59 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-08-16 09:40:59 -0700 |
commit | e5e3bf39f25ed3a2fb45a9ca1f55d6828d81a3eb (patch) | |
tree | 834f67d6ebaf295af0e1d6789bc7f52d120dff33 /src/wasm-linker.h | |
parent | e268d939b86d8639d014b8036e7664d66b6a32e9 (diff) | |
parent | 7851e3a7a3bea679f422116862c5801f1938806d (diff) | |
download | binaryen-e5e3bf39f25ed3a2fb45a9ca1f55d6828d81a3eb.tar.gz binaryen-e5e3bf39f25ed3a2fb45a9ca1f55d6828d81a3eb.tar.bz2 binaryen-e5e3bf39f25ed3a2fb45a9ca1f55d6828d81a3eb.zip |
Merge pull request #668 from WebAssembly/tables_n_memories
Tables and memories
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); |