summaryrefslogtreecommitdiff
path: root/src/ir/module-splitting.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/module-splitting.cpp')
-rw-r--r--src/ir/module-splitting.cpp11
1 files changed, 3 insertions, 8 deletions
diff --git a/src/ir/module-splitting.cpp b/src/ir/module-splitting.cpp
index e24dd6452..8294e1575 100644
--- a/src/ir/module-splitting.cpp
+++ b/src/ir/module-splitting.cpp
@@ -612,14 +612,9 @@ void ModuleSplitter::shareImportableItems() {
// TODO: Be more selective by only sharing global items that are actually used
// in the secondary module, just like we do for functions.
- if (primary.memory.exists) {
- secondary.memory.exists = true;
- secondary.memory.initial = primary.memory.initial;
- secondary.memory.max = primary.memory.max;
- secondary.memory.shared = primary.memory.shared;
- secondary.memory.indexType = primary.memory.indexType;
- makeImportExport(
- primary.memory, secondary.memory, "memory", ExternalKind::Memory);
+ for (auto& memory : primary.memories) {
+ auto secondaryMemory = ModuleUtils::copyMemory(memory.get(), secondary);
+ makeImportExport(*memory, *secondaryMemory, "memory", ExternalKind::Memory);
}
for (auto& table : primary.tables) {