Skip to content

Commit 28d3100

Browse files
Be explicit that we're handling bytes
Co-authored-by: Aleksey Kladov <[email protected]>
1 parent fd959c1 commit 28d3100

File tree

1 file changed

+1
-1
lines changed
  • compiler/rustc_middle/src/mir/interpret

1 file changed

+1
-1
lines changed

compiler/rustc_middle/src/mir/interpret/mod.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -569,7 +569,7 @@ pub fn write_target_uint(
569569

570570
#[inline]
571571
pub fn read_target_uint(endianness: Endian, mut source: &[u8]) -> Result<u128, io::Error> {
572-
let mut buf = [0; 16];
572+
let mut buf = [0u8; std::mem::size_of::<u128>()];
573573
source.read(&mut buf)?;
574574
match endianness {
575575
Endian::Little => Ok(u128::from_le_bytes(buf)),

0 commit comments

Comments
 (0)