From 9749eb72af8f817fd72c0a7cdad324a9baa8b635 Mon Sep 17 00:00:00 2001 From: Ralf Jung Date: Wed, 28 Oct 2020 14:01:04 +0100 Subject: [PATCH] fix aliasing issues in SipHasher --- library/core/src/hash/sip.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/library/core/src/hash/sip.rs b/library/core/src/hash/sip.rs index a9882d54de4..6178b0af137 100644 --- a/library/core/src/hash/sip.rs +++ b/library/core/src/hash/sip.rs @@ -111,7 +111,7 @@ macro_rules! load_int_le { debug_assert!($i + mem::size_of::<$int_ty>() <= $buf.len()); let mut data = 0 as $int_ty; ptr::copy_nonoverlapping( - $buf.get_unchecked($i), + $buf.as_ptr().add($i), &mut data as *mut _ as *mut u8, mem::size_of::<$int_ty>(), );