authorgravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2025-01-29 17:20:29+11:00
committergravatar for 4678790+dweiller@users.noreply.github.comDominic <4678790+dweiller@users.noreply.github.com> 2025-01-30 19:56:57+11:00
log3294ef792f4f40a32948268ba95d34bdba058e06
tree90e0920aabb97d69cebdb2f93cd2d396c45a9eb5
parent7e7c36fb5736d345e791d1656b285cb40f4e97a6

compiler-rt: only check dest/src start address in memmove


1 files changed, 1 insertions(+), 1 deletions(-)

lib/compiler_rt/memmove.zig+1-1
...@@ -47,7 +47,7 @@ fn memmoveFast(dest: ?[*]u8, src: ?[*]u8, len: usize) callconv(.C) ?[*]u8 {...@@ -47,7 +47,7 @@ fn memmoveFast(dest: ?[*]u8, src: ?[*]u8, len: usize) callconv(.C) ?[*]u8 {
47 const dest_address = @intFromPtr(dest);47 const dest_address = @intFromPtr(dest);
48 const src_address = @intFromPtr(src);48 const src_address = @intFromPtr(src);
4949
50 if (src_address < dest_address and src_address + len > dest_address) {50 if (src_address < dest_address) {
51 copyBackwards(dest.?, src.?, len);51 copyBackwards(dest.?, src.?, len);
52 } else {52 } else {
53 copyForwards(dest.?, src.?, len);53 copyForwards(dest.?, src.?, len);