diff options
| author | dweiller <4678790+dweiller@users.noreply.github.com> | 2025-01-29 17:20:29 +1100 |
|---|---|---|
| committer | dweiller <4678790+dweiller@users.noreply.github.com> | 2025-01-30 19:56:57 +1100 |
| commit | 3294ef792f4f40a32948268ba95d34bdba058e06 (patch) | |
| tree | 90e0920aabb97d69cebdb2f93cd2d396c45a9eb5 | |
| parent | 7e7c36fb5736d345e791d1656b285cb40f4e97a6 (diff) | |
| download | zig-3294ef792f4f40a32948268ba95d34bdba058e06.tar.gz zig-3294ef792f4f40a32948268ba95d34bdba058e06.zip | |
compiler-rt: only check dest/src start address in memmove
| -rw-r--r-- | lib/compiler_rt/memmove.zig | 2 |
1 files changed, 1 insertions, 1 deletions
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); |
