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.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/wasm/wasm-binary.cpp b/src/wasm/wasm-binary.cpp
index b78d6b86b..de82f0656 100644
--- a/src/wasm/wasm-binary.cpp
+++ b/src/wasm/wasm-binary.cpp
@@ -691,6 +691,8 @@ void WasmBinaryWriter::writeFeaturesSection() {
return BinaryConsts::UserSections::ReferenceTypesFeature;
case FeatureSet::Multivalue:
return BinaryConsts::UserSections::MultivalueFeature;
+ case FeatureSet::Anyref:
+ return BinaryConsts::UserSections::AnyrefFeature;
default:
WASM_UNREACHABLE("unexpected feature flag");
}
@@ -1138,6 +1140,8 @@ Type WasmBinaryBuilder::getType() {
return Type::externref;
case BinaryConsts::EncodedType::exnref:
return Type::exnref;
+ case BinaryConsts::EncodedType::anyref:
+ return Type::anyref;
default:
throwError("invalid wasm type: " + std::to_string(type));
}
@@ -1160,6 +1164,8 @@ HeapType WasmBinaryBuilder::getHeapType() {
return HeapType::ExternKind;
case BinaryConsts::EncodedHeapType::exn:
return HeapType::ExnKind;
+ case BinaryConsts::EncodedHeapType::any:
+ return HeapType::AnyKind;
default:
throwError("invalid wasm heap type: " + std::to_string(type));
}
@@ -2203,6 +2209,8 @@ void WasmBinaryBuilder::readFeatures(size_t payloadLen) {
wasm.features.setReferenceTypes();
} else if (name == BinaryConsts::UserSections::MultivalueFeature) {
wasm.features.setMultivalue();
+ } else if (name == BinaryConsts::UserSections::AnyrefFeature) {
+ wasm.features.setAnyref();
}
}
}