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

Method evaluate

crates/fuzzing/src/oracles/diff_wasmtime.rs:157–175  ·  view source on GitHub ↗
(
        &mut self,
        function_name: &str,
        arguments: &[DiffValue],
        _results: &[DiffValueType],
    )

Source from the content-addressed store, hash-verified

155 }
156
157 fn evaluate(
158 &mut self,
159 function_name: &str,
160 arguments: &[DiffValue],
161 _results: &[DiffValueType],
162 ) -> Result<Option<Vec<DiffValue>>> {
163 let arguments: Vec<_> = arguments.iter().map(Val::from).collect();
164
165 let function = self
166 .instance
167 .get_func(&mut self.store, function_name)
168 .expect("unable to access exported function");
169 let ty = function.ty(&self.store);
170 let mut results = vec![Val::I32(0); ty.results().len()];
171 function.call(&mut self.store, &arguments, &mut results)?;
172
173 let results = results.into_iter().map(Val::into).collect();
174 Ok(Some(results))
175 }
176
177 fn get_global(&mut self, name: &str, _ty: DiffValueType) -> Option<DiffValue> {
178 Some(

Callers

nothing calls this directly

Calls 9

OkFunction · 0.85
collectMethod · 0.80
mapMethod · 0.45
iterMethod · 0.45
expectMethod · 0.45
get_funcMethod · 0.45
tyMethod · 0.45
callMethod · 0.45
into_iterMethod · 0.45

Tested by

no test coverage detected