refactor: rename DifferentialWasmiModuleConfig to SingleFunctionModuleConfig
Since we plan to reuse this configuration, we rename it and ensure it has at least 1 type (this resulted in invalid modules).
This commit is contained in:
@@ -563,15 +563,20 @@ pub fn table_ops(
|
||||
}
|
||||
|
||||
/// Configuration options for wasm-smith such that generated modules always
|
||||
/// conform to certain specifications.
|
||||
/// conform to certain specifications: one exported function, one exported
|
||||
/// memory.
|
||||
#[derive(Default, Debug, Arbitrary, Clone)]
|
||||
pub struct DifferentialWasmiModuleConfig;
|
||||
pub struct SingleFunctionModuleConfig;
|
||||
|
||||
impl wasm_smith::Config for DifferentialWasmiModuleConfig {
|
||||
impl wasm_smith::Config for SingleFunctionModuleConfig {
|
||||
fn allow_start_export(&self) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn min_types(&self) -> usize {
|
||||
1
|
||||
}
|
||||
|
||||
fn min_funcs(&self) -> usize {
|
||||
1
|
||||
}
|
||||
@@ -609,7 +614,7 @@ impl wasm_smith::Config for DifferentialWasmiModuleConfig {
|
||||
/// resulting memory image when execution terminates. This relies on the
|
||||
/// module-under-test to be instrumented to bound the execution time. Invoke
|
||||
/// with a module generated by `wasm-smith` using the
|
||||
/// `DiferentialWasmiModuleConfig` configuration type for best results.
|
||||
/// `SingleFunctionModuleConfig` configuration type for best results.
|
||||
///
|
||||
/// May return `None` if we early-out due to a rejected fuzz config; these
|
||||
/// should be rare if modules are generated appropriately.
|
||||
|
||||
@@ -5,7 +5,7 @@ use wasmtime_fuzzing::{generators, oracles};
|
||||
|
||||
fuzz_target!(|data: (
|
||||
generators::Config,
|
||||
wasm_smith::ConfiguredModule<oracles::DifferentialWasmiModuleConfig>
|
||||
wasm_smith::ConfiguredModule<oracles::SingleFunctionModuleConfig>
|
||||
)| {
|
||||
let (config, mut wasm) = data;
|
||||
wasm.ensure_termination(1000);
|
||||
|
||||
Reference in New Issue
Block a user