File tree 1 file changed +14
-0
lines changed
1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 17
17
#![ feature( panic_runtime) ]
18
18
#![ feature( staged_api) ]
19
19
#![ feature( rustc_attrs) ]
20
+ #![ feature( llvm_asm) ]
20
21
21
22
use core:: any:: Any ;
22
23
@@ -55,6 +56,19 @@ pub unsafe extern "C" fn __rust_start_panic(_payload: usize) -> u32 {
55
56
}
56
57
__rust_abort( ) ;
57
58
}
59
+ } else if #[ cfg( all( windows, any( target_arch = "x86" , target_arch = "x86_64" ) ) ) ] {
60
+ // On Windows, use the processor-specific __fastfail mechanism. In Windows 8
61
+ // and later, this will terminate the process immediately without running any
62
+ // in-process exception handlers. In earlier versions of Windows, this
63
+ // sequence of instructions will be treated as an access violation,
64
+ // terminating the process but without necessarily bypassing all exception
65
+ // handlers.
66
+ //
67
+ // https://docs.microsoft.com/en-us/cpp/intrinsics/fastfail
68
+ unsafe fn abort( ) -> ! {
69
+ llvm_asm!( "int $$0x29" :: "{ecx}" ( 7 ) :: : volatile) ; // 7 is FAST_FAIL_FATAL_APP_EXIT
70
+ core:: intrinsics:: unreachable( ) ;
71
+ }
58
72
} else {
59
73
unsafe fn abort( ) -> ! {
60
74
core:: intrinsics:: abort( ) ;
You can’t perform that action at this time.
0 commit comments