mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-26 07:01:33 +00:00
Add a signal handler for macos and linux.
Implementation Notes: - To avoid setjmp, longjmp, and the mess that those create, we instead set the interrupting context of the signal handler to return into the `throw_trap` routine. To my surprise, this actually works. The stack ends up getting unwound normally and the memory-oob error is caught by the trampoline.
This commit is contained in:
@ -4,9 +4,12 @@ use wabt::wat2wasm;
|
||||
|
||||
static WAT: &'static str = r#"
|
||||
(module
|
||||
(memory 1)
|
||||
(type (;0;) (func (param i32) (result i32)))
|
||||
(func (;0;) (type 0) (param i32) (result i32)
|
||||
unreachable)
|
||||
i32.const 0x20000
|
||||
i32.load
|
||||
)
|
||||
(export "select_trap_l" (func 0))
|
||||
)
|
||||
"#;
|
||||
|
Reference in New Issue
Block a user