Skip to content

Commit 0016af0

Browse files
committed
Add back eh_unwind_resume lang item for bootstrap
1 parent 65dd7ac commit 0016af0

File tree

2 files changed

+19
-0
lines changed

2 files changed

+19
-0
lines changed

src/libpanic_abort/lib.rs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,16 @@ pub mod personalities {
116116
1 // `ExceptionContinueSearch`
117117
}
118118

119+
// Similar to above, this corresponds to the `eh_unwind_resume` lang item
120+
// that's only used on Windows currently.
121+
//
122+
// Note that we don't execute landing pads, so this is never called, so it's
123+
// body is empty.
124+
#[no_mangle]
125+
#[cfg(bootstrap)]
126+
#[cfg(all(target_os = "windows", target_env = "gnu"))]
127+
pub extern fn rust_eh_unwind_resume() {}
128+
119129
// These two are called by our startup objects on i686-pc-windows-gnu, but
120130
// they don't need to do anything so the bodies are nops.
121131
#[no_mangle]

src/libpanic_unwind/gcc.rs

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -302,6 +302,15 @@ unsafe fn find_eh_action(context: *mut uw::_Unwind_Context, foreign_exception: b
302302
eh::find_eh_action(lsda, &eh_context, foreign_exception)
303303
}
304304

305+
// See docs in the `unwind` module.
306+
#[cfg(bootstrap)]
307+
#[cfg(all(target_os="windows", any(target_arch = "x86", target_arch = "x86_64"), target_env="gnu"))]
308+
#[lang = "eh_unwind_resume"]
309+
#[unwind(allowed)]
310+
unsafe extern "C" fn rust_eh_unwind_resume(panic_ctx: *mut u8) -> ! {
311+
uw::_Unwind_Resume(panic_ctx as *mut uw::_Unwind_Exception);
312+
}
313+
305314
// Frame unwind info registration
306315
//
307316
// Each module's image contains a frame unwind info section (usually

0 commit comments

Comments
 (0)