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.cpp13
1 files changed, 10 insertions, 3 deletions
diff --git a/src/wasm-linker.cpp b/src/wasm-linker.cpp
index b1160e94a..04deddf4a 100644
--- a/src/wasm-linker.cpp
+++ b/src/wasm-linker.cpp
@@ -49,7 +49,8 @@ void Linker::ensureImport(Name target, std::string signature) {
auto import = new Import;
import->name = import->base = target;
import->module = ENV;
- import->type = ensureFunctionType(signature, &out.wasm);
+ import->functionType = ensureFunctionType(signature, &out.wasm);
+ import->kind = Import::Function;
out.wasm.addImport(import);
}
}
@@ -106,7 +107,12 @@ void Linker::layout() {
}
if (userMaxMemory) out.wasm.memory.max = userMaxMemory / Memory::kPageSize;
- out.wasm.memory.exportName = MEMORY;
+
+ auto memoryExport = make_unique<Export>();
+ memoryExport->name = MEMORY;
+ memoryExport->value = Name::fromInt(0);
+ memoryExport->kind = Export::Memory;
+ out.wasm.addExport(memoryExport.release());
// XXX For now, export all functions marked .globl.
for (Name name : out.globls) exportFunction(name, false);
@@ -333,7 +339,8 @@ void Linker::emscriptenGlue(std::ostream& o) {
auto import = new Import;
import->name = import->base = curr->target;
import->module = ENV;
- import->type = ensureFunctionType(getSig(curr), &parent->out.wasm);
+ import->functionType = ensureFunctionType(getSig(curr), &parent->out.wasm);
+ import->kind = Import::Function;
parent->out.wasm.addImport(import);
}
}