Function wasmer_vm::on_host_stack

source ·
pub fn on_host_stack<F: FnOnce() -> T, T>(f: F) -> T
Expand description

When executing on the Wasm stack, temporarily switch back to the host stack to perform an operation that should not be constrainted by the Wasm stack limits.

This is particularly important since the usage of the Wasm stack is under the control of untrusted code. Malicious code could artificially induce a stack overflow in the middle of a sensitive host operations (e.g. growing a memory) which would be hard to recover from.