pub struct GcOps { /* private fields */ }Expand description
A description of a Wasm module that performs a series of GC operations on
externrefs, i31s, and struct and array objects of its own types.
Implementations§
Source§impl GcOps
impl GcOps
Sourcepub fn to_wasm_binary(&mut self) -> Vec<u8> ⓘ
pub fn to_wasm_binary(&mut self) -> Vec<u8> ⓘ
Serialize this module into a Wasm binary.
The module requires several function imports. See this function’s implementation for their exact types.
The single export of the module is a function “run” that takes
self.num_params parameters of type externref.
The “run” function does not terminate; you should run it with limited fuel. It also is not guaranteed to avoid traps: it may access out-of-bounds of the table.
Sourcepub fn fixup(
&mut self,
encoding_order_grouped: &mut Vec<(RecGroupId, Vec<TypeId>)>,
)
pub fn fixup( &mut self, encoding_order_grouped: &mut Vec<(RecGroupId, Vec<TypeId>)>, )
Fixes this test case such that it becomes valid.
This is necessary because a random mutation (e.g. removing an op in the middle of our sequence) might have made it so that subsequent ops won’t have their expected operand types on the Wasm stack anymore. Furthermore, because we serialize and deserialize test cases, and libFuzzer will occasionally mutate those serialized bytes directly, rather than use one of our custom mutations, we have no guarantee that pre-mutation test cases are even valid! Therefore, we always call this method before translating this “AST”-style representation into a raw Wasm binary.
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for GcOps
impl<'a> Arbitrary<'a> for GcOps
Source§fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
fn arbitrary(u: &mut Unstructured<'a>) -> Result<Self>
Self from the given unstructured data. Read more§fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
fn arbitrary_take_rest(u: Unstructured<'a>) -> Result<Self, Error>
Self from the entirety of the given
unstructured data. Read moreSource§impl DefaultMutate for GcOps
impl DefaultMutate for GcOps
Source§type DefaultMutate = GcOpsMutator
type DefaultMutate = GcOpsMutator
Source§impl<'de> Deserialize<'de> for GcOps
impl<'de> Deserialize<'de> for GcOps
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl Generate<GcOps> for GcOpsMutator
impl Generate<GcOps> for GcOpsMutator
Source§impl Mutate<GcOps> for GcOpsMutator
impl Mutate<GcOps> for GcOpsMutator
Source§fn mutate(&mut self, c: &mut Candidates<'_>, ops: &mut GcOps) -> MutResult<()>
fn mutate(&mut self, c: &mut Candidates<'_>, ops: &mut GcOps) -> MutResult<()>
§fn mutation_count(&self, value: &T, shrink: bool) -> Option<u32>
fn mutation_count(&self, value: &T, shrink: bool) -> Option<u32>
mutate][Mutate::mutate] would
register for the given value. Read more§fn generate_via_mutate(
&mut self,
context: &mut Context,
iters: usize,
) -> Result<T, Error>
fn generate_via_mutate( &mut self, context: &mut Context, iters: usize, ) -> Result<T, Error>
iters times. Read more§fn or<M>(self, other: M) -> Or<Self, M>where
Self: Sized,
fn or<M>(self, other: M) -> Or<Self, M>where
Self: Sized,
other
mutation. Read more§fn map<F>(self, f: F) -> Map<Self, F>
fn map<F>(self, f: F) -> Map<Self, F>
Auto Trait Implementations§
impl Freeze for GcOps
impl RefUnwindSafe for GcOps
impl Send for GcOps
impl Sync for GcOps
impl Unpin for GcOps
impl UnsafeUnpin for GcOps
impl UnwindSafe for GcOps
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more