[libc] fix memcpy builtin looping

previously, memcpy could get stuck in a loop, calling __builtin_memcpy
which would redirect to itself. This patch removes that path.

Reviewed By: gchatelet, sivachandra, lntue

Differential Revision: https://reviews.llvm.org/D115542
This commit is contained in:
Michael Jones 2021-12-10 10:55:38 -08:00
parent d3208cf1cd
commit 467b5017e2
1 changed files with 0 additions and 2 deletions

View File

@ -511,8 +511,6 @@ template <size_t Size> struct Builtin {
// __builtin_memcpy_inline guarantees to never call external functions. // __builtin_memcpy_inline guarantees to never call external functions.
// Unfortunately it is not widely available. // Unfortunately it is not widely available.
__builtin_memcpy_inline(dst, src, SIZE); __builtin_memcpy_inline(dst, src, SIZE);
#elif __has_builtin(__builtin_memcpy)
__builtin_memcpy(dst, src, SIZE);
#else #else
for_loop_copy(dst, src); for_loop_copy(dst, src);
#endif #endif