File tree Expand file tree Collapse file tree 2 files changed +25
-8
lines changed Expand file tree Collapse file tree 2 files changed +25
-8
lines changed Original file line number Diff line number Diff line change @@ -326,22 +326,38 @@ unsafe fn find_eh_action(
326326
327327// See docs in the `unwind` module.
328328#[ cfg( all(
329+ not( bootstrap) ,
330+ target_os = "windows" ,
331+ any( target_arch = "x86" , target_arch = "x86_64" ) ,
332+ target_env = "gnu"
333+ ) ) ]
334+ global_asm ! {
335+ r#"
336+ .def _rust_eh_unwind_resume;
337+ .scl 2;
338+ .type 32;
339+ .endef
340+ .globl _rust_eh_unwind_resume
341+ .p2align 4, 0x90
342+ _rust_eh_unwind_resume:
343+ .cfi_startproc
344+ jmp __Unwind_Resume
345+ .cfi_endproc
346+ "#
347+ }
348+ #[ cfg( all(
349+ bootstrap,
329350 target_os = "windows" ,
330351 any( target_arch = "x86" , target_arch = "x86_64" ) ,
331352 target_env = "gnu"
332353) ) ]
333354#[ lang = "eh_unwind_resume" ]
334355#[ unwind( allowed) ]
335- #[ naked]
336- #[ inline( never) ]
337- unsafe extern "C" fn rust_eh_unwind_resume ( _panic_ctx : * mut u8 ) -> ! {
338- // This needs to be a naked function because _Unwind_Resume expects to be
339- // called directly from the landing pad. This means that we need to force
340- // a tail call here.
341- asm ! ( "jmp ${0:P}" :: "s" ( uw:: _Unwind_Resume as usize ) :: "volatile" ) ;
342- core:: hint:: unreachable_unchecked ( ) ;
356+ unsafe extern "C" fn rust_eh_unwind_resume ( panic_ctx : * mut u8 ) -> ! {
357+ uw:: _Unwind_Resume ( panic_ctx as * mut uw:: _Unwind_Exception ) ;
343358}
344359
360+
345361// Frame unwind info registration
346362//
347363// Each module's image contains a frame unwind info section (usually
Original file line number Diff line number Diff line change 3232#![ feature( naked_functions) ]
3333#![ panic_runtime]
3434#![ feature( panic_runtime) ]
35+ #![ feature( global_asm) ]
3536
3637use alloc:: boxed:: Box ;
3738use core:: any:: Any ;
You can’t perform that action at this time.
0 commit comments