Expand description
Implementation of Wasm to CLIF memory access translation.
Given
- a dynamic Wasm memory index operand,
- a static offset immediate, and
- a static access size,
bounds check the memory access and translate it into a native memory access.
!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! !!! !!! !!! THIS CODE IS VERY SUBTLE, HAS MANY SPECIAL CASES, AND IS ALSO !!! !!! ABSOLUTELY CRITICAL FOR MAINTAINING THE SAFETY OF THE WASM HEAP !!! !!! SANDBOX. !!! !!! !!! !!! A good rule of thumb is to get two reviews on any substantive !!! !!! changes in here. !!! !!! !!! !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!
Enumsยง
- AddrPcc ๐Which facts do we want to emit for proof-carrying code, if any, on address computations?
Functionsยง
- Helper used to emit bounds checks (as necessary) and compute the native address of a heap access.
- compute_addr ๐Emit code for the native address computation of a Wasm address, without any bounds checks or overflow checks.
- Emit explicit checks on the given out-of-bounds condition for the Wasm address and return the native address.
- Get the bound of a dynamic heap as an
ir::Value
. - offset_plus_size ๐