Skip to content

Define default-value constructors for various Wasm types in the host API #10437

Open
@fitzgen

Description

@fitzgen

We already have code to create default values in order to implement https://docs.rs/wasmtime/latest/wasmtime/struct.Linker.html#method.define_unknown_imports_as_default_values

We have duplicates of that code in the fuzzing utility crate: https://github.com/bytecodealliance/wasmtime/blob/main/crates/fuzzing/src/oracles/dummy.rs

We should just expose those constructors in the public API of the wasmtime crate, move the various fuzzing oracles over to these methods, and then delete 95% of that wasmtime_fuzzing::oracles::dummy module.

I am thinking that we will want to expose these as pub fn default_value(&self, store: impl AsContextMut) -> Option<T> methods on wasmtime::{ExternType,GlobalType,MemoryType,ValType,...} where T is wasmtime::Memory for the wasmtime::MemoryType method, etc...

Metadata

Metadata

Assignees

No one assigned

    Labels

    good first issueIssues that are good for new contributors to tackle!

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions