Skip to content

Commit

Permalink
Expose the configured WasmFeatures from FuncValidator (#1858)
Browse files Browse the repository at this point in the history
This is useful for Wasmtime to check whether it should emit full subtyping
checks on `call_indirect` instructions when the Wasm GC proposal is enabled or
just do a strict equality test.
  • Loading branch information
fitzgen authored Oct 10, 2024
1 parent 1e22a83 commit ec56644
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions crates/wasmparser/src/validator/func.rs
Original file line number Diff line number Diff line change
Expand Up @@ -189,6 +189,11 @@ impl<T: WasmModuleResources> FuncValidator<T> {
self.validator.finish(offset)
}

/// Returns the Wasm features enabled for this validator.
pub fn features(&self) -> &WasmFeatures {
&self.validator.features
}

/// Returns the underlying module resources that this validator is using.
pub fn resources(&self) -> &T {
&self.resources
Expand Down

0 comments on commit ec56644

Please sign in to comment.