summaryrefslogtreecommitdiff
path: root/src/wasm/wasm-binary.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/wasm/wasm-binary.cpp')
-rw-r--r--src/wasm/wasm-binary.cpp10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index f710c8bc1..0c931f518 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -1354,6 +1354,10 @@ void WasmBinaryWriter::writeFeaturesSection() {
return BinaryConsts::CustomSections::SharedEverythingFeature;
case FeatureSet::FP16:
return BinaryConsts::CustomSections::FP16Feature;
+ case FeatureSet::BulkMemoryOpt:
+ return BinaryConsts::CustomSections::BulkMemoryOptFeature;
+ case FeatureSet::CallIndirectOverlong:
+ return BinaryConsts::CustomSections::CallIndirectOverlongFeature;
case FeatureSet::None:
case FeatureSet::Default:
case FeatureSet::All:
@@ -4790,6 +4794,12 @@ void WasmBinaryReader::readFeatures(size_t payloadLen) {
feature = FeatureSet::Atomics;
} else if (name == BinaryConsts::CustomSections::BulkMemoryFeature) {
feature = FeatureSet::BulkMemory;
+ if (used) {
+ // For backward compatibility, enable this dependent feature.
+ feature |= FeatureSet::BulkMemoryOpt;
+ }
+ } else if (name == BinaryConsts::CustomSections::BulkMemoryOptFeature) {
+ feature = FeatureSet::BulkMemoryOpt;
} else if (name == BinaryConsts::CustomSections::ExceptionHandlingFeature) {
feature = FeatureSet::ExceptionHandling;
} else if (name == BinaryConsts::CustomSections::MutableGlobalsFeature) {