summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimur Iskhodzhanov <timurrrr@google.com>2014-08-12 11:02:53 +0000
committerTimur Iskhodzhanov <timurrrr@google.com>2014-08-12 11:02:53 +0000
commit6963686c4731b24dd0de91bf7057be08dbd983a1 (patch)
tree6081989f2ca9031e563807d0dd43eb59b2144567
parentde1718d355393f2c12430797346a555aca4e912d (diff)
downloadbcm5719-llvm-6963686c4731b24dd0de91bf7057be08dbd983a1.tar.gz
bcm5719-llvm-6963686c4731b24dd0de91bf7057be08dbd983a1.zip
[ASan] Use more appropriate return types for strlen/wcslen to avoid MSVC warnings
llvm-svn: 215436
-rw-r--r--compiler-rt/lib/asan/asan_interceptors.cc8
-rw-r--r--compiler-rt/lib/asan/asan_interceptors.h2
2 files changed, 5 insertions, 5 deletions
diff --git a/compiler-rt/lib/asan/asan_interceptors.cc b/compiler-rt/lib/asan/asan_interceptors.cc
index 95674a829d5..6fd6746934c 100644
--- a/compiler-rt/lib/asan/asan_interceptors.cc
+++ b/compiler-rt/lib/asan/asan_interceptors.cc
@@ -550,7 +550,7 @@ INTERCEPTOR(char*, strdup, const char *s) {
}
#endif
-INTERCEPTOR(uptr, strlen, const char *s) {
+INTERCEPTOR(unsigned, strlen, const char *s) {
if (UNLIKELY(!asan_inited)) return internal_strlen(s);
// strlen is called from malloc_default_purgeable_zone()
// in __asan::ReplaceSystemAlloc() on Mac.
@@ -558,15 +558,15 @@ INTERCEPTOR(uptr, strlen, const char *s) {
return REAL(strlen)(s);
}
ENSURE_ASAN_INITED();
- uptr length = REAL(strlen)(s);
+ unsigned length = REAL(strlen)(s);
if (flags()->replace_str) {
ASAN_READ_RANGE(s, length + 1);
}
return length;
}
-INTERCEPTOR(uptr, wcslen, const wchar_t *s) {
- uptr length = REAL(wcslen)(s);
+INTERCEPTOR(unsigned, wcslen, const wchar_t *s) {
+ unsigned length = REAL(wcslen)(s);
if (!asan_init_is_running) {
ENSURE_ASAN_INITED();
ASAN_READ_RANGE(s, (length + 1) * sizeof(wchar_t));
diff --git a/compiler-rt/lib/asan/asan_interceptors.h b/compiler-rt/lib/asan/asan_interceptors.h
index c5d1af0c01d..ebf3d69ffbf 100644
--- a/compiler-rt/lib/asan/asan_interceptors.h
+++ b/compiler-rt/lib/asan/asan_interceptors.h
@@ -86,7 +86,7 @@ DECLARE_REAL(int, memcmp, const void *a1, const void *a2, uptr size)
DECLARE_REAL(void*, memcpy, void *to, const void *from, uptr size)
DECLARE_REAL(void*, memset, void *block, int c, uptr size)
DECLARE_REAL(char*, strchr, const char *str, int c)
-DECLARE_REAL(uptr, strlen, const char *s)
+DECLARE_REAL(unsigned, strlen, const char *s)
DECLARE_REAL(char*, strncpy, char *to, const char *from, uptr size)
DECLARE_REAL(uptr, strnlen, const char *s, uptr maxlen)
DECLARE_REAL(char*, strstr, const char *s1, const char *s2)
OpenPOWER on IntegriCloud