Skip to content

Commit c6708e6

Browse files
Re-export _Unwind_Resume
1 parent a2d6604 commit c6708e6

File tree

4 files changed

+16
-8
lines changed

4 files changed

+16
-8
lines changed

src/libpanic_unwind/gcc.rs

Lines changed: 13 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -324,19 +324,25 @@ unsafe fn find_eh_action(
324324
eh::find_eh_action(lsda, &eh_context, foreign_exception)
325325
}
326326

327-
// See docs in the `unwind` module.
327+
#[cfg(all(
328+
target_os = "windows",
329+
any(target_arch = "x86", target_arch = "x86_64"),
330+
target_env = "gnu"
331+
))]
332+
#[cfg_attr(not(bootstrap), lang = "eh_unwind_resume")]
333+
#[used]
334+
pub static RESUME: unsafe extern "C" fn(*mut uw::_Unwind_Exception) -> ! =
335+
uw::_Unwind_Resume as unsafe extern "C" fn(_) -> !;
336+
328337
#[cfg(all(
329338
target_os = "windows",
330339
any(target_arch = "x86", target_arch = "x86_64"),
331340
target_env = "gnu"
332341
))]
333342
#[lang = "eh_unwind_resume"]
334-
#[unwind(allowed)]
335-
// This must always be inlined because _Unwind_Resume expects to be called
336-
// directly from the landing pad.
337-
#[cfg_attr(not(bootstrap), inline(always))]
338-
unsafe extern "C" fn rust_eh_unwind_resume(panic_ctx: *mut u8) -> ! {
339-
uw::_Unwind_Resume(panic_ctx as *mut uw::_Unwind_Exception);
343+
#[cfg(bootstrap)]
344+
pub unsafe extern "C" fn rust_eh_unwind_resume(p: *mut u8) -> ! {
345+
uw::_Unwind_Resume(p as *mut uw::_Unwind_Exception)
340346
}
341347

342348
// Frame unwind info registration

src/libpanic_unwind/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
#![feature(raw)]
3131
#![panic_runtime]
3232
#![feature(panic_runtime)]
33+
#![allow(dead_code)]
3334

3435
use alloc::boxed::Box;
3536
use core::any::Any;

src/librustc/middle/lang_items.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -385,7 +385,7 @@ language_item_table! {
385385
StartFnLangItem, "start", start_fn, Target::Fn;
386386

387387
EhPersonalityLangItem, "eh_personality", eh_personality, Target::Fn;
388-
EhUnwindResumeLangItem, "eh_unwind_resume", eh_unwind_resume, Target::Fn;
388+
EhUnwindResumeLangItem, "eh_unwind_resume", eh_unwind_resume, Target::Static;
389389
EhCatchTypeinfoLangItem, "eh_catch_typeinfo", eh_catch_typeinfo, Target::Static;
390390

391391
OwnedBoxLangItem, "owned_box", owned_box, Target::Struct;

src/libunwind/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@
44
#![feature(nll)]
55
#![feature(staged_api)]
66
#![feature(unwind_attributes)]
7+
#![feature(lang_items)]
78
#![feature(static_nobundle)]
89
#![cfg_attr(not(target_env = "msvc"), feature(libc))]
910

0 commit comments

Comments
 (0)