Skip to content

Commit 828a59e

Browse files
committed
---
yaml --- r: 277811 b: refs/heads/try c: 38e6e5d h: refs/heads/master i: 277809: 55abebc 277807: 1ef55ce
1 parent 636e098 commit 828a59e

File tree

9 files changed

+338
-202
lines changed

9 files changed

+338
-202
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 6dbb0e86aec11050480beb76eade6fb805010ba7
33
refs/heads/snap-stage3: 235d77457d80b549dad3ac36d94f235208a1eafb
4-
refs/heads/try: 0ec321f7b541fcbfbf20286beb497e6d9d3352b2
4+
refs/heads/try: 38e6e5d0a9681b53cb517a3af665059e83988c3d
55
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
66
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596
77
refs/tags/release-0.3: b5f0d0f648d9a6153664837026ba1be43d3e2503

branches/try/src/libpanic_abort/lib.rs

Lines changed: 36 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -93,20 +93,43 @@ pub unsafe extern fn __rust_start_panic(_data: usize, _vtable: usize) -> u32 {
9393
// Essentially this symbol is just defined to get wired up to libcore/libstd
9494
// binaries, but it should never be called as we don't link in an unwinding
9595
// runtime at all.
96-
#[no_mangle]
9796
#[cfg(not(stage0))]
98-
pub extern fn rust_eh_personality() {}
97+
pub mod personalities {
9998

100-
// Similar to above, this corresponds to the `eh_unwind_resume` lang item that's
101-
// only used on Windows currently.
102-
#[no_mangle]
103-
#[cfg(all(not(stage0), target_os = "windows", target_env = "gnu"))]
104-
pub extern fn rust_eh_unwind_resume() {}
99+
#[no_mangle]
100+
#[cfg(not(all(target_os = "windows",
101+
target_env = "gnu",
102+
target_arch = "x86_64")))]
103+
pub extern fn rust_eh_personality() {}
105104

106-
#[no_mangle]
107-
#[cfg(all(target_os = "windows", target_env = "gnu", target_arch = "x86"))]
108-
pub extern fn rust_eh_register_frames() {}
105+
// On x86_64-pc-windows-gnu we use our own personality function that needs
106+
// to return `ExceptionContinueSearch` as we're passing on all our frames.
107+
#[no_mangle]
108+
#[cfg(all(target_os = "windows",
109+
target_env = "gnu",
110+
target_arch = "x86_64"))]
111+
pub extern fn rust_eh_personality(_record: usize,
112+
_frame: usize,
113+
_context: usize,
114+
_dispatcher: usize) -> u32 {
115+
1 // `ExceptionContinueSearch`
116+
}
109117

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

0 commit comments

Comments
 (0)