[−][src]Module wasmer_singlepass_backend::protect_unix
Installing signal handlers allows us to handle traps and out-of-bounds memory accesses that occur when runniing WebAssembly.
This code is inspired by: https://github.com/pepyakin/wasmtime/commit/625a2b6c0815b21996e111da51b9664feb174622
When a WebAssembly module triggers any traps, we perform recovery here.
This module uses TLS (thread-local storage) to track recovery information. Since the four signals we're handling are very special, the async signal unsafety of Rust's TLS implementation generally does not affect the correctness here unless you have memory unsafety elsewhere in your code.
Enums
CallProtError |
Constants
TRAP_EARLY_DATA |
Functions
call_protected | |
throw⚠ | |
trigger_trap⚠ |