Function wasmer_compiler_cranelift::translator::code_translator::prepare_addr
source ยท fn prepare_addr<FE>(
memarg: &MemArg,
access_size: u8,
builder: &mut FunctionBuilder<'_>,
state: &mut FuncTranslationState,
environ: &mut FE,
) -> WasmResult<Reachability<(MemFlags, Value, Value)>>where
FE: FuncEnvironment + ?Sized,
Expand description
This function is a generalized helper for validating that a wasm-supplied heap address is in-bounds.
This function takes a litany of parameters and requires that the Wasm
address to be verified is at the top of the stack in state
. This will
generate necessary IR to validate that the heap address is correctly
in-bounds, and various parameters are returned describing the valid native
heap address if execution reaches that point.
Returns None
when the Wasm access will unconditionally trap.
Returns (flags, wasm_addr, native_addr)
.