Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
Philip Woolford
seahash
Commits
e6549443
Commit
e6549443
authored
Apr 10, 2019
by
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
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/helper.rs
View file @
e6549443
...
...
@@ -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 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"
)]
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment