File tree Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Expand file tree Collapse file tree 2 files changed +23
-9
lines changed Original file line number Diff line number Diff line change 11use crate :: { Error , Signal } ;
2- use std:: { mem, ops :: DerefMut , ptr} ;
2+ use std:: { mem, ptr} ;
33
44// std::cmp::max is not const :(
55const fn get_stack_size ( ) -> usize {
@@ -438,6 +438,8 @@ impl HandlerInner {
438438 let mut cc = CRASH_CONTEXT . lock ( ) ;
439439
440440 {
441+ use std:: ops:: DerefMut ;
442+ #[ allow( clippy:: explicit_deref_methods) ]
441443 ptr:: write_bytes ( cc. deref_mut ( ) , 0 , 1 ) ;
442444 debug_print ! ( "zeroed crashctx" ) ;
443445
Original file line number Diff line number Diff line change @@ -315,8 +315,7 @@ pub fn assert_minidump(md_buf: &[u8], signal: Signal) {
315315 ( $expected: pat) => {
316316 assert!(
317317 matches!( crash_reason, $expected) ,
318- "crash reason: {:?}" ,
319- crash_reason
318+ "crash reason: {crash_reason:?}" ,
320319 ) ;
321320 } ;
322321 }
@@ -336,14 +335,27 @@ pub fn assert_minidump(md_buf: &[u8], signal: Signal) {
336335 ) ) ;
337336 }
338337 Signal :: Fpe => {
339- verify ! ( CrashReason :: LinuxSigfpe (
340- errors:: ExceptionCodeLinuxSigfpeKind :: FPE_INTDIV
341- ) ) ;
338+ if cfg ! ( not( any( target_arch = "aarch64" , target_arch = "arm" ) ) ) {
339+ verify ! ( CrashReason :: LinuxSigfpe (
340+ errors:: ExceptionCodeLinuxSigfpeKind :: FPE_INTDIV
341+ ) ) ;
342+ } else {
343+ verify ! ( CrashReason :: LinuxGeneral (
344+ errors:: ExceptionCodeLinux :: SIGFPE ,
345+ 4294967290
346+ ) ) ;
347+ }
342348 }
343349 Signal :: Illegal => {
344- verify ! ( CrashReason :: LinuxSigill (
345- errors:: ExceptionCodeLinuxSigillKind :: ILL_ILLOPN
346- ) ) ;
350+ if cfg ! ( not( any( target_arch = "aarch64" , target_arch = "arm" ) ) ) {
351+ verify ! ( CrashReason :: LinuxSigill (
352+ errors:: ExceptionCodeLinuxSigillKind :: ILL_ILLOPN
353+ ) ) ;
354+ } else {
355+ verify ! ( CrashReason :: LinuxSigill (
356+ errors:: ExceptionCodeLinuxSigillKind :: ILL_ILLOPC
357+ ) ) ;
358+ }
347359 }
348360 Signal :: Segv => {
349361 verify ! ( CrashReason :: LinuxSigsegv (
You can’t perform that action at this time.
0 commit comments