mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-13 17:11:21 +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:
@ -115,7 +115,7 @@ public:
|
||||
}
|
||||
|
||||
uint32_t type_id, value_num;
|
||||
uint64_t values[];
|
||||
uint64_t values[1];
|
||||
};
|
||||
|
||||
struct WasmModule {
|
||||
@ -140,7 +140,7 @@ extern "C" {
|
||||
return RESULT_OK;
|
||||
}
|
||||
|
||||
void throw_trap(WasmTrap::Type ty) {
|
||||
[[noreturn]] void throw_trap(WasmTrap::Type ty) {
|
||||
throw WasmTrap(ty);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user