forked from OSchip/llvm-project
[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:
parent
d3208cf1cd
commit
467b5017e2
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue