Remove custom signal handler restrictions (#1843)

* remove custom signal handler origin restriction

* add a test for handling signals from a hostcall

* cargo fmt
This commit is contained in:
Maciej Woś
2020-06-09 02:33:28 +09:00
committed by GitHub
parent 4bb58940c7
commit 7ab5f2a869
2 changed files with 55 additions and 9 deletions

View File

@@ -589,11 +589,6 @@ impl<'a> CallThreadState<'a> {
return ptr::null();
}
// If this fault wasn't in wasm code, then it's not our problem
if !(self.is_wasm_code)(pc as usize) {
return ptr::null();
}
// First up see if any instance registered has a custom trap handler,
// in which case run them all. If anything handles the trap then we
// return that the trap was handled.
@@ -603,6 +598,11 @@ impl<'a> CallThreadState<'a> {
}
}
// If this fault wasn't in wasm code, then it's not our problem
if !(self.is_wasm_code)(pc as usize) {
return ptr::null();
}
// TODO: stack overflow can happen at any random time (i.e. in malloc()
// in memory.grow) and it's really hard to determine if the cause was
// stack overflow and if it happened in WebAssembly module.