Skip to content

Commit

Permalink
Do not destructure maybe-uninit fields
Browse files Browse the repository at this point in the history
  • Loading branch information
workingjubilee committed Aug 29, 2024
1 parent 3858946 commit 153f510
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions src/symbolize/gimli/libs_dl_iterate_phdr.rs
Original file line number Diff line number Diff line change
Expand Up @@ -45,13 +45,10 @@ unsafe extern "C" fn callback(
vec: *mut libc::c_void,
) -> libc::c_int {
// SAFETY: We are guaranteed these fields:
let libc::dl_phdr_info {
dlpi_addr,
dlpi_name,
dlpi_phdr,
dlpi_phnum,
..
} = unsafe { *info };
let dlpi_addr = unsafe { (*info).dlpi_addr };
let dlpi_name = unsafe { (*info).dlpi_name };
let dlpi_phdr = unsafe { (*info).dlpi_phdr };
let dlpi_phnum = unsafe { (*info).dlpi_phnum };
// SAFETY: We assured this.
let libs = unsafe { &mut *vec.cast::<Vec<Library>>() };
// most implementations give us the main program first
Expand Down

0 comments on commit 153f510

Please sign in to comment.