File tree 2 files changed +25
-8
lines changed
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(
326
326
327
327
// See docs in the `unwind` module.
328
328
#[ 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,
329
350
target_os = "windows" ,
330
351
any( target_arch = "x86" , target_arch = "x86_64" ) ,
331
352
target_env = "gnu"
332
353
) ) ]
333
354
#[ lang = "eh_unwind_resume" ]
334
355
#[ 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 ) ;
343
358
}
344
359
360
+
345
361
// Frame unwind info registration
346
362
//
347
363
// Each module's image contains a frame unwind info section (usually
Original file line number Diff line number Diff line change 32
32
#![ feature( naked_functions) ]
33
33
#![ panic_runtime]
34
34
#![ feature( panic_runtime) ]
35
+ #![ feature( global_asm) ]
35
36
36
37
use alloc:: boxed:: Box ;
37
38
use core:: any:: Any ;
You can’t perform that action at this time.
0 commit comments