Skip to content

Commit

Permalink
miri
Browse files Browse the repository at this point in the history
  • Loading branch information
kazuyukitanimura committed Aug 24, 2024
1 parent 25c309e commit 7905330
Showing 1 changed file with 1 addition and 6 deletions.
7 changes: 1 addition & 6 deletions arrow-buffer/src/util/bit_mask.rs
Original file line number Diff line number Diff line change
Expand Up @@ -129,13 +129,8 @@ unsafe fn read_bytes_to_u64(data: &[u8], offset: usize, count: usize) -> u64 {

#[cfg(miri)]
unsafe fn read_bytes_to_u64(data: &[u8], offset: usize, count: usize) -> u64 {
let mut tmp = std::mem::MaybeUninit::<u64>::uninit();
let src = data.as_ptr().add(offset);
// SAFETY: the caller must not use the uninitialized `8 - count` bytes in the returned value.
unsafe {
std::ptr::copy_nonoverlapping(src, tmp.as_mut_ptr() as *mut u8, count);
tmp.assume_init_read()
}
u64::from_le_bytes(src.to_le_bytes())
}

#[inline]
Expand Down

0 comments on commit 7905330

Please sign in to comment.