Skip to content

Commit b8da91b

Browse files
committed
fixup! [compiler-rt][asan] Add wcscpy/wcsncpy; enable wcscat/wcsncat on Windows
Code style. Signed-off-by: Yixuan Cao <[email protected]>
1 parent 0127791 commit b8da91b

File tree

2 files changed

+9
-9
lines changed

2 files changed

+9
-9
lines changed

compiler-rt/lib/asan/asan_interceptors.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -60,15 +60,15 @@ static inline uptr MaybeRealStrnlen(const char *s, uptr maxlen) {
6060
#if SANITIZER_INTERCEPT_STRNLEN
6161
if (REAL(strnlen))
6262
return REAL(strnlen)(s, maxlen);
63-
#endif
63+
# endif
6464
return internal_strnlen(s, maxlen);
6565
}
6666

67-
static inline uptr MaybeRealWcsnlen(const wchar_t *s, uptr maxlen) {
68-
#if SANITIZER_INTERCEPT_WCSNLEN
67+
static inline uptr MaybeRealWcsnlen(const wchar_t* s, uptr maxlen) {
68+
# if SANITIZER_INTERCEPT_WCSNLEN
6969
if (REAL(wcsnlen))
7070
return REAL(wcsnlen)(s, maxlen);
71-
#endif
71+
# endif
7272
return internal_wcsnlen(s, maxlen);
7373
}
7474

@@ -577,8 +577,8 @@ INTERCEPTOR(char *, strcpy, char *to, const char *from) {
577577
return REAL(strcpy)(to, from);
578578
}
579579

580-
INTERCEPTOR(wchar_t *, wcscpy, wchar_t *to, const wchar_t *from) {
581-
void *ctx;
580+
INTERCEPTOR(wchar_t*, wcscpy, wchar_t* to, const wchar_t* from) {
581+
void* ctx;
582582
ASAN_INTERCEPTOR_ENTER(ctx, wcscpy);
583583
if (!TryAsanInitFromRtl())
584584
return REAL(wcscpy)(to, from);
@@ -654,8 +654,8 @@ INTERCEPTOR(char*, strncpy, char *to, const char *from, usize size) {
654654
return REAL(strncpy)(to, from, size);
655655
}
656656

657-
INTERCEPTOR(wchar_t *, wcsncpy, wchar_t *to, const wchar_t *from, uptr size) {
658-
void *ctx;
657+
INTERCEPTOR(wchar_t*, wcsncpy, wchar_t* to, const wchar_t* from, uptr size) {
658+
void* ctx;
659659
ASAN_INTERCEPTOR_ENTER(ctx, wcsncpy);
660660
AsanInitFromRtl();
661661
if (flags()->replace_str) {

compiler-rt/lib/asan/asan_interceptors.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -129,7 +129,7 @@ DECLARE_REAL(char*, strchr, const char *str, int c)
129129
DECLARE_REAL(SIZE_T, strlen, const char *s)
130130
DECLARE_REAL(char*, strncpy, char *to, const char *from, SIZE_T size)
131131
DECLARE_REAL(SIZE_T, strnlen, const char *s, SIZE_T maxlen)
132-
DECLARE_REAL(SIZE_T, wcsnlen, const wchar_t *s, SIZE_T maxlen)
132+
DECLARE_REAL(SIZE_T, wcsnlen, const wchar_t* s, SIZE_T maxlen)
133133
DECLARE_REAL(char*, strstr, const char *s1, const char *s2)
134134

135135
# if !SANITIZER_APPLE

0 commit comments

Comments
 (0)