Skip to content

Commit fe2a867

Browse files
Be explicit that we're handling bytes
Co-authored-by: Aleksey Kladov <aleksey.kladov@gmail.com>
1 parent 74b4eea commit fe2a867

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
@@ -570,7 +570,7 @@ pub fn write_target_uint(
570570

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

0 commit comments

Comments
 (0)