Skip to content

Commit

Permalink
Try replacing anonymous struct by a placeholder
Browse files Browse the repository at this point in the history
This way alignment remains right.
It should work as long as clients
do not try to access obfuscated fields.
  • Loading branch information
victorpaleologue committed Mar 23, 2023
1 parent 89cd883 commit 8bb4cff
Showing 1 changed file with 1 addition and 11 deletions.
12 changes: 1 addition & 11 deletions src/unix/linux_like/linux/musl/b32/x86/mod.rs
Expand Up @@ -3,11 +3,6 @@ pub type wchar_t = i32;
pub type greg_t = i32;

s! {
pub struct _libc_fpreg {
pub significand: [u16; 4],
pub exponent: u16,
}

pub struct stat {
pub st_dev: ::dev_t,
__st_dev_padding: ::c_int,
Expand Down Expand Up @@ -118,11 +113,6 @@ s! {
pub f_spare: [::c_ulong; 4],
}

pub struct _fpreg {
pub significand: [u16; 4],
pub exponent: u16,
}

pub struct _fpstate {
pub cw: ::c_ulong,
pub sw: ::c_ulong,
Expand All @@ -131,7 +121,7 @@ s! {
pub cssel: ::c_ulong,
pub dataoff: ::c_ulong,
pub datasel: ::c_ulong,
pub _st: [_libc_fpreg; 8],
pub _st: [u16; 40], // anonymous struct replaced by a placeholder
pub status: ::c_ulong,
}

Expand Down

0 comments on commit 8bb4cff

Please sign in to comment.