File tree Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Expand file tree Collapse file tree 1 file changed +14
-0
lines changed Original file line number Diff line number Diff line change 1717#![ feature( panic_runtime) ]
1818#![ feature( staged_api) ]
1919#![ feature( rustc_attrs) ]
20+ #![ feature( llvm_asm) ]
2021
2122use core:: any:: Any ;
2223
@@ -55,6 +56,19 @@ pub unsafe extern "C" fn __rust_start_panic(_payload: usize) -> u32 {
5556 }
5657 __rust_abort( ) ;
5758 }
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+ }
5872 } else {
5973 unsafe fn abort( ) -> ! {
6074 core:: intrinsics:: abort( ) ;
You can’t perform that action at this time.
0 commit comments