diff options
| author | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-11-06 08:09:55 -0500 |
|---|---|---|
| committer | Mark Rousskov <mark.simulacrum@gmail.com> | 2019-11-12 16:36:57 -0500 |
| commit | 997feacddd8f6e98003428265c665f7149c49a48 (patch) | |
| tree | f44b97e054e863224a1a94bde6011488df57e470 /src/libpanic_unwind | |
| parent | f4edc81ac4944c2cd59e19fd90861a26dde94041 (diff) | |
| download | rust-997feacddd8f6e98003428265c665f7149c49a48.tar.gz rust-997feacddd8f6e98003428265c665f7149c49a48.zip | |
Snap cfgs
Diffstat (limited to 'src/libpanic_unwind')
| -rw-r--r-- | src/libpanic_unwind/seh.rs | 24 |
1 files changed, 2 insertions, 22 deletions
diff --git a/src/libpanic_unwind/seh.rs b/src/libpanic_unwind/seh.rs index 621813a2fee..2bddcbc4422 100644 --- a/src/libpanic_unwind/seh.rs +++ b/src/libpanic_unwind/seh.rs @@ -98,9 +98,6 @@ use libc::{c_int, c_uint, c_void}; mod imp { pub type ptr_t = *mut u8; - #[cfg(bootstrap)] - pub const NAME1: [u8; 7] = [b'.', b'P', b'A', b'_', b'K', 0, 0]; - macro_rules! ptr { (0) => (core::ptr::null_mut()); ($e:expr) => ($e as *mut u8); @@ -112,9 +109,6 @@ mod imp { mod imp { pub type ptr_t = u32; - #[cfg(bootstrap)] - pub const NAME1: [u8; 7] = [b'.', b'P', b'E', b'A', b'_', b'K', 0]; - extern "C" { pub static __ImageBase: u8; } @@ -161,17 +155,11 @@ pub struct _PMD { pub struct _TypeDescriptor { pub pVFTable: *const u8, pub spare: *mut u8, - #[cfg(bootstrap)] - pub name: [u8; 7], - #[cfg(not(bootstrap))] pub name: [u8; 11], } // Note that we intentionally ignore name mangling rules here: we don't want C++ // to be able to catch Rust panics by simply declaring a `struct rust_panic`. -#[cfg(bootstrap)] -use imp::NAME1 as TYPE_NAME; -#[cfg(not(bootstrap))] const TYPE_NAME: [u8; 11] = *b"rust_panic\0"; static mut THROW_INFO: _ThrowInfo = _ThrowInfo { @@ -194,9 +182,6 @@ static mut CATCHABLE_TYPE: _CatchableType = _CatchableType { pdisp: -1, vdisp: 0, }, - #[cfg(bootstrap)] - sizeOrOffset: mem::size_of::<*mut u64>() as c_int, - #[cfg(not(bootstrap))] sizeOrOffset: mem::size_of::<[u64; 2]>() as c_int, copy_function: ptr!(0), }; @@ -218,8 +203,7 @@ extern "C" { // an argument to the C++ personality function. // // Again, I'm not entirely sure what this is describing, it just seems to work. -#[cfg_attr(bootstrap, lang = "msvc_try_filter")] -#[cfg_attr(not(any(test, bootstrap)), lang = "eh_catch_typeinfo")] +#[cfg_attr(not(test), lang = "eh_catch_typeinfo")] static mut TYPE_DESCRIPTOR: _TypeDescriptor = _TypeDescriptor { pVFTable: unsafe { &TYPE_INFO_VTABLE } as *const _ as *const _, spare: core::ptr::null_mut(), @@ -239,11 +223,7 @@ pub unsafe fn panic(data: Box<dyn Any + Send>) -> u32 { let ptrs = mem::transmute::<_, raw::TraitObject>(data); let mut ptrs = [ptrs.data as u64, ptrs.vtable as u64]; let mut ptrs_ptr = ptrs.as_mut_ptr(); - let throw_ptr = if cfg!(bootstrap) { - &mut ptrs_ptr as *mut _ as *mut _ - } else { - ptrs_ptr as *mut _ - }; + let throw_ptr = ptrs_ptr as *mut _; // This... may seems surprising, and justifiably so. On 32-bit MSVC the // pointers between these structure are just that, pointers. On 64-bit MSVC, |
