Skip to content

Commit fb3c6e2

Browse files
authored
Read call-indirect-overlong and custom-descriptors features (#7524)
These features were previously missed when reading target features sections.
1 parent 526986b commit fb3c6e2

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

src/wasm/wasm-binary.cpp

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4979,6 +4979,9 @@ void WasmBinaryReader::readFeatures(size_t payloadLen) {
49794979
}
49804980
} else if (name == BinaryConsts::CustomSections::BulkMemoryOptFeature) {
49814981
feature = FeatureSet::BulkMemoryOpt;
4982+
} else if (name ==
4983+
BinaryConsts::CustomSections::CallIndirectOverlongFeature) {
4984+
feature = FeatureSet::CallIndirectOverlong;
49824985
} else if (name == BinaryConsts::CustomSections::ExceptionHandlingFeature) {
49834986
feature = FeatureSet::ExceptionHandling;
49844987
} else if (name == BinaryConsts::CustomSections::MutableGlobalsFeature) {
@@ -5013,6 +5016,8 @@ void WasmBinaryReader::readFeatures(size_t payloadLen) {
50135016
feature = FeatureSet::SharedEverything;
50145017
} else if (name == BinaryConsts::CustomSections::FP16Feature) {
50155018
feature = FeatureSet::FP16;
5019+
} else if (name == BinaryConsts::CustomSections::CustomDescriptorsFeature) {
5020+
feature = FeatureSet::CustomDescriptors;
50165021
} else {
50175022
// Silently ignore unknown features (this may be and old binaryen running
50185023
// on a new wasm).

test/unit/test_features.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -451,4 +451,6 @@ def test_emit_all_features(self):
451451
'--enable-shared-everything',
452452
'--enable-fp16',
453453
'--enable-bulk-memory-opt',
454+
'--enable-call-indirect-overlong',
455+
'--enable-custom-descriptors',
454456
], p2.stdout.splitlines())

0 commit comments

Comments
 (0)