summaryrefslogtreecommitdiff
path: root/src/ir/memory-utils.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/ir/memory-utils.h')
-rw-r--r--src/ir/memory-utils.h6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/ir/memory-utils.h b/src/ir/memory-utils.h
index 0bad50c5a..fbf1f646c 100644
--- a/src/ir/memory-utils.h
+++ b/src/ir/memory-utils.h
@@ -69,6 +69,12 @@ namespace MemoryUtils {
return true;
}
+ // Conservatively refuse to change segments if there might be memory.init
+ // and data.drop instructions.
+ if (module.features.hasBulkMemory()) {
+ return false;
+ }
+
auto isEmpty = [](Memory::Segment& segment) {
return segment.data.size() == 0;
};