From 3294ef792f4f40a32948268ba95d34bdba058e06 Mon Sep 17 00:00:00 2001 From: dweiller <4678790+dweiller@users.noreply.github.com> Date: Wed, 29 Jan 2025 17:20:29 +1100 Subject: [PATCH] compiler-rt: only check dest/src start address in memmove --- lib/compiler_rt/memmove.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/compiler_rt/memmove.zig b/lib/compiler_rt/memmove.zig index 79c82df884..c136e80c7c 100644 --- a/lib/compiler_rt/memmove.zig +++ b/lib/compiler_rt/memmove.zig @@ -47,7 +47,7 @@ fn memmoveFast(dest: ?[*]u8, src: ?[*]u8, len: usize) callconv(.C) ?[*]u8 { const dest_address = @intFromPtr(dest); const src_address = @intFromPtr(src); - if (src_address < dest_address and src_address + len > dest_address) { + if (src_address < dest_address) { copyBackwards(dest.?, src.?, len); } else { copyForwards(dest.?, src.?, len);