MCPcopy Create free account
hub / github.com/bytecodealliance/wasmtime / new

Method new

crates/fuzzing/src/oracles/diff_wasmtime.rs:23–40  ·  view source on GitHub ↗

Merely store the configuration; the engine is actually constructed later. Ideally the store and engine could be built here but `compile_module` takes a [`generators::Config`]; TODO re-factor this if that ever changes.

(
        u: &mut Unstructured<'_>,
        config: &mut generators::Config,
        compiler_strategy: CompilerStrategy,
    )

Source from the content-addressed store, hash-verified

21 /// `compile_module` takes a [`generators::Config`]; TODO re-factor this if
22 /// that ever changes.
23 pub fn new(
24 u: &mut Unstructured<'_>,
25 config: &mut generators::Config,
26 compiler_strategy: CompilerStrategy,
27 ) -> arbitrary::Result<Self> {
28 let mut new_config = u.arbitrary::<WasmtimeConfig>()?;
29 new_config.compiler_strategy = compiler_strategy;
30 new_config.update_module_config(&mut config.module_config, u)?;
31 new_config.make_compatible_with(&config.wasmtime);
32
33 let config = generators::Config {
34 wasmtime: new_config,
35 module_config: config.module_config.clone(),
36 };
37 log::debug!("Created new Wasmtime differential engine with config: {config:?}");
38
39 Ok(Self { config })
40 }
41}
42
43impl DiffEngine for WasmtimeEngine {

Callers

nothing calls this directly

Calls 7

OkFunction · 0.85
dummy_linkerFunction · 0.85
update_module_configMethod · 0.80
make_compatible_withMethod · 0.80
cloneMethod · 0.45
contextMethod · 0.45
instantiateMethod · 0.45

Tested by

no test coverage detected