[compiler-rt] r216184 - Follow-up for r215436: use SIZE_T for strlen and wcslen interceptors.

Alexander Potapenko glider at google.com
Thu Aug 21 09:12:46 PDT 2014


Author: glider
Date: Thu Aug 21 11:12:46 2014
New Revision: 216184

URL: http://llvm.org/viewvc/llvm-project?rev=216184&view=rev
Log:
Follow-up for r215436: use SIZE_T for strlen and wcslen interceptors.


Modified:
    compiler-rt/trunk/lib/asan/asan_interceptors.cc
    compiler-rt/trunk/lib/asan/asan_interceptors.h

Modified: compiler-rt/trunk/lib/asan/asan_interceptors.cc
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.cc?rev=216184&r1=216183&r2=216184&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.cc (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.cc Thu Aug 21 11:12:46 2014
@@ -550,7 +550,7 @@ INTERCEPTOR(char*, strdup, const char *s
 }
 #endif
 
-INTERCEPTOR(unsigned, strlen, const char *s) {
+INTERCEPTOR(SIZE_T, 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(unsigned, strlen, const char
     return REAL(strlen)(s);
   }
   ENSURE_ASAN_INITED();
-  unsigned length = REAL(strlen)(s);
+  SIZE_T length = REAL(strlen)(s);
   if (flags()->replace_str) {
     ASAN_READ_RANGE(s, length + 1);
   }
   return length;
 }
 
-INTERCEPTOR(unsigned, wcslen, const wchar_t *s) {
-  unsigned length = REAL(wcslen)(s);
+INTERCEPTOR(SIZE_T, wcslen, const wchar_t *s) {
+  SIZE_T length = REAL(wcslen)(s);
   if (!asan_init_is_running) {
     ENSURE_ASAN_INITED();
     ASAN_READ_RANGE(s, (length + 1) * sizeof(wchar_t));

Modified: compiler-rt/trunk/lib/asan/asan_interceptors.h
URL: http://llvm.org/viewvc/llvm-project/compiler-rt/trunk/lib/asan/asan_interceptors.h?rev=216184&r1=216183&r2=216184&view=diff
==============================================================================
--- compiler-rt/trunk/lib/asan/asan_interceptors.h (original)
+++ compiler-rt/trunk/lib/asan/asan_interceptors.h Thu Aug 21 11:12:46 2014
@@ -86,7 +86,7 @@ DECLARE_REAL(int, memcmp, const void *a1
 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(unsigned, strlen, const char *s)
+DECLARE_REAL(SIZE_T, 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)





More information about the llvm-commits mailing list