mirror of
https://github.com/fluencelabs/wasmer
synced 2025-06-22 05:01:33 +00:00
Support checking the execution limit exceeded error.
This commit is contained in:
@ -128,11 +128,12 @@ pub fn call_protected<T>(f: impl FnOnce() -> T) -> Result<T, CallProtError> {
|
||||
}
|
||||
}
|
||||
|
||||
pub unsafe extern "C" fn throw() -> ! {
|
||||
pub unsafe fn throw(payload: Box<dyn Any>) -> ! {
|
||||
let jmp_buf = SETJMP_BUFFER.with(|buf| buf.get());
|
||||
if *jmp_buf == [0; SETJMP_BUFFER_LEN] {
|
||||
::std::process::abort();
|
||||
}
|
||||
TRAP_EARLY_DATA.with(|cell| cell.replace(Some(payload)));
|
||||
longjmp(jmp_buf as *mut ::nix::libc::c_void, 0xffff);
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user