Commit e6549443 authored by Philip Woolford's avatar Philip Woolford
Browse files

Fix `helper::read_u64` on 32-bit systems

This fixes tests that fail when built on 32-bit systems.
parent 66932603
...@@ -60,7 +60,7 @@ pub unsafe fn read_u64(ptr: *const u8) -> u64 { ...@@ -60,7 +60,7 @@ pub unsafe fn read_u64(ptr: *const u8) -> u64 {
{ {
// We cannot be sure about the memory layout of a potentially emulated 64-bit integer, so // We cannot be sure about the memory layout of a potentially emulated 64-bit integer, so
// we read it manually. If possible, the compiler should emit proper instructions. // we read it manually. If possible, the compiler should emit proper instructions.
(*(ptr as *const u32)).to_le() as u64 | ((*(ptr as *const u32)).to_le() as u64) << 32 (*(ptr as *const u32)).to_le() as u64 | ((*(ptr.offset(4) as *const u32)).to_le() as u64) << 32
} }
#[cfg(target_pointer_width = "64")] #[cfg(target_pointer_width = "64")]
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment