diff options
Diffstat (limited to 'libc/src/string/memmove.cpp')
| -rw-r--r-- | libc/src/string/memmove.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/libc/src/string/memmove.cpp b/libc/src/string/memmove.cpp index ba1b29bf9876..3b6866fd9f01 100644 --- a/libc/src/string/memmove.cpp +++ b/libc/src/string/memmove.cpp @@ -7,6 +7,7 @@ //===----------------------------------------------------------------------===// #include "src/string/memmove.h" +#include "src/string/memory_utils/memcpy_implementations.h" #include "src/string/memory_utils/memmove_implementations.h" #include <stddef.h> // size_t @@ -14,7 +15,10 @@ namespace __llvm_libc { LLVM_LIBC_FUNCTION(void *, memmove, (void *dst, const void *src, size_t count)) { - inline_memmove(dst, src, count); + if (is_disjoint(dst, src, count)) + inline_memcpy(dst, src, count); + else + inline_memmove(dst, src, count); return dst; } |
