Add initial differential fuzzing

Part of #611
This commit is contained in:
Nick Fitzgerald
2020-01-16 16:39:28 -08:00
parent 815576edc5
commit 1bf8de35f3
5 changed files with 237 additions and 8 deletions

View File

@@ -70,6 +70,11 @@ pub fn dummy_value(val_ty: &ValType) -> Result<Val, Trap> {
})
}
/// Construct a sequence of dummy values for the given types.
pub fn dummy_values(val_tys: &[ValType]) -> Result<Vec<Val>, Trap> {
val_tys.iter().map(dummy_value).collect()
}
/// Construct a dummy global for the given global type.
pub fn dummy_global(store: &Store, ty: GlobalType) -> Result<Global, Trap> {
let val = dummy_value(ty.content())?;