fuzz: add a single instruction module generator (#4409)

* fuzz: add a single instruction module generator

As proposed by @cfallin in #3251, this change adds a way to generate a
Wasm module for a single instruction. It captures the necessary
parameter and result types so that fuzzing can not only choose which
instruction to check but also generate values to pass to the
instruction. Not all instructions are available yet, but a significant
portion of scalar instructions are implemented in this change.

This does not wire the generator up to any fuzz targets.

* review: use raw string in test

* review: remove once_cell, use slices

* review: refactor macros to use valtype!

* review: avoid cloning when choosing a SingleInstModule
This commit is contained in:
Andrew Brown
2022-07-07 15:50:59 -07:00
committed by GitHub
parent b9e63fe77a
commit a8ce7f123b
2 changed files with 316 additions and 0 deletions

View File

@@ -15,6 +15,7 @@ mod instance_allocation_strategy;
mod instance_limits;
mod memory;
mod module_config;
mod single_inst_module;
mod spec_test;
pub mod table_ops;
@@ -24,4 +25,5 @@ pub use instance_allocation_strategy::InstanceAllocationStrategy;
pub use instance_limits::InstanceLimits;
pub use memory::{MemoryConfig, NormalMemoryConfig, UnalignedMemory, UnalignedMemoryCreator};
pub use module_config::ModuleConfig;
pub use single_inst_module::SingleInstModule;
pub use spec_test::SpecTest;