Skip to content

Commit 90eb7be

Browse files
committed
[libc] Fix memcpy to adhere to qualified calls.
Summary: Switched to using the new memcpy implementation. Reviewers: sivachandra, abrachet, gchatelet Reviewed By: abrachet, gchatelet Subscribers: mgorny, MaskRay, tschuett, libc-commits Tags: #libc-project Differential Revision: https://reviews.llvm.org/D77277
1 parent fcab66d commit 90eb7be

File tree

4 files changed

+8
-1
lines changed

4 files changed

+8
-1
lines changed

libc/fuzzing/string/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,5 @@ add_libc_fuzzer(
55
DEPENDS
66
strcpy
77
strlen
8+
memcpy
89
)

libc/src/string/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ add_entrypoint_object(
2121
DEPENDS
2222
string_h
2323
strlen
24+
memcpy
2425
)
2526

2627
add_entrypoint_object(

libc/src/string/strcpy.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,14 +8,15 @@
88

99
#include "src/string/strcpy.h"
1010
#include "src/string/strlen.h"
11+
#include "src/string/memcpy.h"
1112

1213
#include "src/__support/common.h"
1314

1415
namespace __llvm_libc {
1516

1617
char *LLVM_LIBC_ENTRYPOINT(strcpy)(char *dest, const char *src) {
1718
return reinterpret_cast<char *>(
18-
::memcpy(dest, src, __llvm_libc::strlen(src) + 1));
19+
__llvm_libc::memcpy(dest, src, __llvm_libc::strlen(src) + 1));
1920
}
2021

2122
} // namespace __llvm_libc

libc/test/src/string/CMakeLists.txt

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,8 @@ add_libc_unittest(
1212
strcat
1313
strcpy
1414
strlen
15+
# TODO (sivachandra): remove redundant deps.
16+
memcpy
1517
)
1618

1719
add_libc_unittest(
@@ -23,6 +25,8 @@ add_libc_unittest(
2325
DEPENDS
2426
strcpy
2527
strlen
28+
# TODO (sivachandra): remove redundant deps.
29+
memcpy
2630
)
2731

2832
add_libc_unittest(

0 commit comments

Comments
 (0)