Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 1 addition & 5 deletions src/wasm-binary.h
Original file line number Diff line number Diff line change
Expand Up @@ -1156,11 +1156,7 @@ enum MemoryAccess {

enum MemoryFlags { HasMaximum = 1 << 0, IsShared = 1 << 1, Is64 = 1 << 2 };

enum FeaturePrefix {
FeatureUsed = '+',
FeatureRequired = '=',
FeatureDisallowed = '-'
};
enum FeaturePrefix { FeatureUsed = '+', FeatureDisallowed = '-' };

} // namespace BinaryConsts

Expand Down
8 changes: 2 additions & 6 deletions src/wasm/wasm-binary.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3816,15 +3816,11 @@ void WasmBinaryReader::readFeatures(size_t payloadLen) {
uint8_t prefix = getInt8();

bool disallowed = prefix == BinaryConsts::FeatureDisallowed;
bool required = prefix == BinaryConsts::FeatureRequired;
bool used = prefix == BinaryConsts::FeatureUsed;

if (!disallowed && !required && !used) {
if (!disallowed && !used) {
throwError("Unrecognized feature policy prefix");
}
if (required) {
std::cerr << "warning: required features in feature section are ignored";
}

Name name = getInlineString();
if (pos > sectionPos + payloadLen) {
Expand Down Expand Up @@ -3881,7 +3877,7 @@ void WasmBinaryReader::readFeatures(size_t payloadLen) {
<< "warning: feature " << feature.toString()
<< " was enabled by the user, but disallowed in the features section.";
}
if (required || used) {
if (used) {
wasm.features.enable(feature);
}
}
Expand Down