We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent aa75260 commit de4ed28Copy full SHA for de4ed28
src/mem/x86_64.rs
@@ -35,7 +35,7 @@ pub unsafe extern "C" fn memcpy(dest: *mut u8, src: *const u8, count: usize) ->
35
36
#[cfg_attr(all(feature = "mem", not(feature = "mangled-names")), no_mangle)]
37
pub unsafe extern "C" fn memmove(dest: *mut u8, src: *const u8, count: usize) -> *mut u8 {
38
- let delta = dest as usize - src as usize;
+ let delta = (dest as usize).wrapping_sub(src as usize);
39
if delta >= count {
40
// We can copy forwards because either dest is far enough ahead of src,
41
// or src is ahead of dest (and delta overflowed).
0 commit comments