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

Method enable_async

crates/fuzzing/src/generators/config.rs:549–562  ·  view source on GitHub ↗

Updates this configuration to forcibly enable async support. Only useful in fuzzers which do async calls.

(&mut self, u: &mut Unstructured<'_>)

Source from the content-addressed store, hash-verified

547 /// Updates this configuration to forcibly enable async support. Only useful
548 /// in fuzzers which do async calls.
549 pub fn enable_async(&mut self, u: &mut Unstructured<'_>) -> arbitrary::Result<()> {
550 if self.wasmtime.consume_fuel || u.arbitrary()? {
551 self.wasmtime.async_config =
552 AsyncConfig::YieldWithFuel(u.int_in_range(1000..=100_000)?);
553 self.wasmtime.consume_fuel = true;
554 } else {
555 self.wasmtime.async_config = AsyncConfig::YieldWithEpochs {
556 dur: Duration::from_millis(u.int_in_range(1..=10)?),
557 ticks: u.int_in_range(1..=10)?,
558 };
559 self.wasmtime.epoch_interruption = true;
560 }
561 Ok(())
562 }
563}
564
565impl<'a> Arbitrary<'a> for Config {

Callers 3

wast_testFunction · 0.80
storeFunction · 0.80
run_oneFunction · 0.80

Calls 2

OkFunction · 0.85
arbitraryMethod · 0.45

Tested by

no test coverage detected