[Windows] Handle crashes without exception (#912)

* Handle that exception_pointers can be null

* Fix formatting

* windows: Handle crashes without exception
This commit is contained in:
Max Ammann 2022-12-10 01:29:27 +01:00 committed by GitHub
parent f9eac18542
commit 2f9b279428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -1294,10 +1294,10 @@ mod windows_exception_handler {
compiler_fence(Ordering::SeqCst);
}
#[cfg(feature = "std")]
if let Some(exception_pointers) = exception_pointers.as_mut() {
let code = ExceptionCode::try_from(
exception_pointers
.as_mut()
.unwrap()
.ExceptionRecord
.as_mut()
.unwrap()
@ -1305,9 +1305,11 @@ mod windows_exception_handler {
.0,
)
.unwrap();
#[cfg(feature = "std")]
eprintln!("Crashed with {}", code);
} else {
eprintln!("Crashed without exception (probably due to SIGABRT)");
};
if data.current_input_ptr.is_null() {
#[cfg(feature = "std")]
{