pub struct Stacks {
pub limit: Option<NonZeroUsize>,
/* private fields */
}Expand description
Generate a Wasm module that keeps track of its current call stack, to compare to the host.
Fields§
§limit: Option<NonZeroUsize>The maximum number of backtrace frames to collect, or None to disable
backtrace collection.
Implementations§
Source§impl Stacks
impl Stacks
Sourcepub fn wasm(&self) -> Vec<u8> ⓘ
pub fn wasm(&self) -> Vec<u8> ⓘ
Get this test case’s Wasm module.
The Wasm module has the following imports:
-
host.check_stack: [] -> []: The host can check the Wasm’s understanding of its own stack against the host’s understanding of the Wasm stack to find discrepancy bugs. -
host.call_func: [funcref] -> []: The host should call the givenfuncref, creating a call stack with multiple sequences of contiguous Wasm frames on the stack like[..., wasm, host, wasm].
The Wasm module has the following exports:
-
run: [i32] -> []: This function should be called with each of the input values to run this generated test case. -
get_stack: [] -> [i32 i32]: Get the pointer and length of theu32array of this Wasm’s understanding of its stack. This is useful for checking whether the host’s view of the stack at a trap matches the Wasm program’s understanding.
Trait Implementations§
Source§impl<'a> Arbitrary<'a> for Stacks
impl<'a> Arbitrary<'a> for Stacks
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 moreAuto Trait Implementations§
impl Freeze for Stacks
impl RefUnwindSafe for Stacks
impl Send for Stacks
impl Sync for Stacks
impl Unpin for Stacks
impl UnsafeUnpin for Stacks
impl UnwindSafe for Stacks
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
§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