File tree 1 file changed +7
-11
lines changed
1 file changed +7
-11
lines changed Original file line number Diff line number Diff line change @@ -527,17 +527,13 @@ pub unsafe extern "C" fn start_trap_rust(trap_frame: *const TrapFrame) {
527
527
528
528
match xcause:: read ( ) . cause ( ) {
529
529
xcause:: Trap :: Interrupt ( code) => _dispatch_core_interrupt ( code) ,
530
- xcause:: Trap :: Exception ( code) => {
531
- let trap_frame = & * trap_frame;
532
- if code < __EXCEPTIONS. len ( ) {
533
- let h = & __EXCEPTIONS[ code] ;
534
- if let Some ( handler) = h {
535
- handler ( trap_frame) ;
536
- } else {
537
- ExceptionHandler ( trap_frame) ;
538
- }
539
- } else {
540
- ExceptionHandler ( trap_frame) ;
530
+ xcause:: Trap :: Exception ( code) if code < __EXCEPTIONS. len ( ) => {
531
+ match __EXCEPTIONS[ code] . as_ref ( ) {
532
+ Some ( handler) => handler ( & * trap_frame) ,
533
+ None => ExceptionHandler ( & * trap_frame) ,
534
+ }
535
+ }
536
+ xcause:: Trap :: Exception ( _) => ExceptionHandler ( & * trap_frame) ,
541
537
}
542
538
}
543
539
}
You can’t perform that action at this time.
0 commit comments