summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHenry <mail@henrygressmann.de>2026-08-12 18:10:07 +0200
committerHenry <mail@henrygressmann.de>2026-08-12 18:10:07 +0200
commit68f85f6d2ed5870e497a5e87a40ec4e3f440984f (patch)
treee9e971c7b5bdeea58e7ba424fc7063b4eb98328f
parente862a9ef83957b2e1e92e211922ce4e131c6e2b3 (diff)
chore: simplify validator feature set, allow compact imports
Signed-off-by: Henry <mail@henrygressmann.de>
-rw-r--r--CHANGELOG.md1
-rw-r--r--crates/parser/src/lib.rs26
2 files changed, 6 insertions, 21 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 64366f4..51f68d5 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
- Added support for the WebAssembly function-references proposal
- Added basic support for the WebAssembly garbage-collection proposal
- Added support for the WebAssembly exception-handling proposal, including tags, `try_table`, `throw`, and `throw_ref`
+- Added support for the WebAssembly compact-imports proposal
- Added `WasmValue::ty` and `WasmValue::matches_type`
- Added `ValueLane` for mapping WebAssembly value types to their physical 32-bit, 64-bit, or 128-bit storage lane.
- Added a `validate` feature to `tinywasm` and `tinywasm-parser` (enabled by default) to optionally skip wasmparser validation for faster parsing of trusted modules.
diff --git a/crates/parser/src/lib.rs b/crates/parser/src/lib.rs
index 8b6cb39..8db7920 100644
--- a/crates/parser/src/lib.rs
+++ b/crates/parser/src/lib.rs
@@ -170,27 +170,11 @@ impl Parser {
fn validator(&self) -> Option<Validator> {
#[cfg(feature = "validate")]
{
- let features = WasmFeatures::CALL_INDIRECT_OVERLONG
- | WasmFeatures::BULK_MEMORY_OPT
- | WasmFeatures::RELAXED_SIMD
- | WasmFeatures::GC_TYPES
- | WasmFeatures::GC
- | WasmFeatures::REFERENCE_TYPES
- | WasmFeatures::MUTABLE_GLOBAL
- | WasmFeatures::MULTI_VALUE
- | WasmFeatures::FLOATS
- | WasmFeatures::BULK_MEMORY
- | WasmFeatures::SATURATING_FLOAT_TO_INT
- | WasmFeatures::SIGN_EXTENSION
- | WasmFeatures::EXTENDED_CONST
- | WasmFeatures::FUNCTION_REFERENCES
- | WasmFeatures::TAIL_CALL
- | WasmFeatures::MULTI_MEMORY
- | WasmFeatures::SIMD
- | WasmFeatures::MEMORY64
- | WasmFeatures::CUSTOM_PAGE_SIZES
- | WasmFeatures::EXCEPTIONS
- | WasmFeatures::WIDE_ARITHMETIC;
+ let features = WasmFeatures::WASM3
+ .difference(WasmFeatures::THREADS)
+ .union(WasmFeatures::CUSTOM_PAGE_SIZES)
+ .union(WasmFeatures::WIDE_ARITHMETIC)
+ .union(WasmFeatures::COMPACT_IMPORTS);
self.options.validation().then(|| Validator::new_with_features(features))
}
#[cfg(not(feature = "validate"))]