fuzz: Increase table limit in differential_v8 fuzzer (#3879)

When manually increasing the table limit in this specific fuzzer we also
need to increase the limit in the pooling allocator itself if
configured.
This commit is contained in:
Alex Crichton
2022-03-03 11:24:01 -06:00
committed by GitHub
parent 38d0d426f2
commit d3fd1ebe5f

View File

@@ -2,6 +2,7 @@
use libfuzzer_sys::arbitrary::{Result, Unstructured};
use libfuzzer_sys::fuzz_target;
use wasmtime_fuzzing::generators::InstanceAllocationStrategy;
use wasmtime_fuzzing::{generators, oracles};
fuzz_target!(|data: &[u8]| {
@@ -23,6 +24,13 @@ fn run(data: &[u8]) -> Result<()> {
// Allow multiple tables, as set_differential_config() assumes reference
// types are disabled and therefore sets max_tables to 1
config.module_config.config.max_tables = 4;
if let InstanceAllocationStrategy::Pooling {
instance_limits: limits,
..
} = &mut config.wasmtime.strategy
{
limits.tables = 4;
}
let module = config.generate(&mut u, Some(1000))?;
oracles::differential_v8_execution(&module.to_bytes(), &config);