@@ -344,7 +344,7 @@ extern const short *_tolower_tab_;
344344#ifndef COMMON_INTERCEPTOR_STRNDUP_IMPL
345345#define COMMON_INTERCEPTOR_STRNDUP_IMPL (ctx, s, size ) \
346346 COMMON_INTERCEPTOR_ENTER (ctx, strndup, s, size); \
347- uptr copy_length = internal_strnlen(s, size); \
347+ usize copy_length = internal_strnlen(s, size); \
348348 char *new_mem = (char *)WRAP(malloc)(copy_length + 1 ); \
349349 if (common_flags()->intercept_strndup) { \
350350 COMMON_INTERCEPTOR_READ_STRING (ctx, s, Min (size, copy_length + 1 )); \
@@ -445,7 +445,7 @@ INTERCEPTOR(SIZE_T, strnlen, const char *s, SIZE_T maxlen) {
445445#endif
446446
447447#if SANITIZER_INTERCEPT_STRNDUP
448- INTERCEPTOR (char *, strndup, const char *s, uptr size) {
448+ INTERCEPTOR (char *, strndup, const char *s, usize size) {
449449 void *ctx;
450450 COMMON_INTERCEPTOR_STRNDUP_IMPL (ctx, s, size);
451451}
@@ -455,7 +455,7 @@ INTERCEPTOR(char*, strndup, const char *s, uptr size) {
455455#endif // SANITIZER_INTERCEPT_STRNDUP
456456
457457#if SANITIZER_INTERCEPT___STRNDUP
458- INTERCEPTOR (char *, __strndup, const char *s, uptr size) {
458+ INTERCEPTOR (char *, __strndup, const char *s, usize size) {
459459 void *ctx;
460460 COMMON_INTERCEPTOR_STRNDUP_IMPL (ctx, s, size);
461461}
@@ -494,7 +494,7 @@ INTERCEPTOR(int, strcmp, const char *s1, const char *s2) {
494494 void *ctx;
495495 COMMON_INTERCEPTOR_ENTER (ctx, strcmp, s1, s2);
496496 unsigned char c1, c2;
497- uptr i;
497+ usize i;
498498 for (i = 0 ;; i++) {
499499 c1 = (unsigned char )s1[i];
500500 c2 = (unsigned char )s2[i];
@@ -511,23 +511,23 @@ INTERCEPTOR(int, strcmp, const char *s1, const char *s2) {
511511}
512512
513513DECLARE_WEAK_INTERCEPTOR_HOOK (__sanitizer_weak_hook_strncmp, uptr called_pc,
514- const char *s1, const char *s2, uptr n,
514+ const char *s1, const char *s2, usize n,
515515 int result)
516516
517- INTERCEPTOR(int , strncmp, const char *s1, const char *s2, uptr size) {
517+ INTERCEPTOR(int , strncmp, const char *s1, const char *s2, usize size) {
518518 if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)
519519 return internal_strncmp (s1, s2, size);
520520 void *ctx;
521521 COMMON_INTERCEPTOR_ENTER (ctx, strncmp, s1, s2, size);
522522 unsigned char c1 = 0 , c2 = 0 ;
523- uptr i;
523+ usize i;
524524 for (i = 0 ; i < size; i++) {
525525 c1 = (unsigned char )s1[i];
526526 c2 = (unsigned char )s2[i];
527527 if (c1 != c2 || c1 == ' \0 ' ) break ;
528528 }
529- uptr i1 = i;
530- uptr i2 = i;
529+ usize i1 = i;
530+ usize i2 = i;
531531 if (common_flags ()->strict_string_checks ) {
532532 for (; i1 < size && s1[i1]; i1++) {}
533533 for (; i2 < size && s2[i2]; i2++) {}
@@ -561,7 +561,7 @@ INTERCEPTOR(int, strcasecmp, const char *s1, const char *s2) {
561561 void *ctx;
562562 COMMON_INTERCEPTOR_ENTER (ctx, strcasecmp, s1, s2);
563563 unsigned char c1 = 0 , c2 = 0 ;
564- uptr i;
564+ usize i;
565565 for (i = 0 ;; i++) {
566566 c1 = (unsigned char )s1[i];
567567 c2 = (unsigned char )s2[i];
@@ -576,21 +576,21 @@ INTERCEPTOR(int, strcasecmp, const char *s1, const char *s2) {
576576}
577577
578578DECLARE_WEAK_INTERCEPTOR_HOOK (__sanitizer_weak_hook_strncasecmp, uptr called_pc,
579- const char *s1, const char *s2, uptr size,
579+ const char *s1, const char *s2, usize size,
580580 int result)
581581
582582INTERCEPTOR(int , strncasecmp, const char *s1, const char *s2, SIZE_T size) {
583583 void *ctx;
584584 COMMON_INTERCEPTOR_ENTER (ctx, strncasecmp, s1, s2, size);
585585 unsigned char c1 = 0 , c2 = 0 ;
586- uptr i;
586+ usize i;
587587 for (i = 0 ; i < size; i++) {
588588 c1 = (unsigned char )s1[i];
589589 c2 = (unsigned char )s2[i];
590590 if (CharCaseCmp (c1, c2) != 0 || c1 == ' \0 ' ) break ;
591591 }
592- uptr i1 = i;
593- uptr i2 = i;
592+ usize i1 = i;
593+ usize i2 = i;
594594 if (common_flags ()->strict_string_checks ) {
595595 for (; i1 < size && s1[i1]; i1++) {}
596596 for (; i2 < size && s2[i2]; i2++) {}
@@ -613,8 +613,8 @@ INTERCEPTOR(int, strncasecmp, const char *s1, const char *s2, SIZE_T size) {
613613#if SANITIZER_INTERCEPT_STRSTR || SANITIZER_INTERCEPT_STRCASESTR
614614static inline void StrstrCheck (void *ctx, char *r, const char *s1,
615615 const char *s2) {
616- uptr len1 = internal_strlen (s1);
617- uptr len2 = internal_strlen (s2);
616+ usize len1 = internal_strlen (s1);
617+ usize len2 = internal_strlen (s2);
618618 COMMON_INTERCEPTOR_READ_STRING (ctx, s1, r ? r - s1 + len2 : len1 + 1 );
619619 COMMON_INTERCEPTOR_READ_RANGE (ctx, s2, len2 + 1 );
620620}
@@ -758,7 +758,7 @@ INTERCEPTOR(char*, strchrnul, const char *s, int c) {
758758 void *ctx;
759759 COMMON_INTERCEPTOR_ENTER (ctx, strchrnul, s, c);
760760 char *result = REAL (strchrnul)(s, c);
761- uptr len = result - s + 1 ;
761+ usize len = result - s + 1 ;
762762 if (common_flags ()->intercept_strchr )
763763 COMMON_INTERCEPTOR_READ_STRING (ctx, s, len);
764764 return result;
@@ -833,13 +833,13 @@ INTERCEPTOR(char *, strpbrk, const char *s1, const char *s2) {
833833
834834#if SANITIZER_INTERCEPT_MEMCMP
835835DECLARE_WEAK_INTERCEPTOR_HOOK (__sanitizer_weak_hook_memcmp, uptr called_pc,
836- const void *s1, const void *s2, uptr n,
836+ const void *s1, const void *s2, usize n,
837837 int result)
838838
839839// Common code for `memcmp` and `bcmp`.
840840int MemcmpInterceptorCommon(void *ctx,
841- int (*real_fn)(const void *, const void *, uptr ),
842- const void *a1, const void *a2, uptr size) {
841+ int (*real_fn)(const void *, const void *, usize ),
842+ const void *a1, const void *a2, usize size) {
843843 if (common_flags ()->intercept_memcmp ) {
844844 if (common_flags ()->strict_memcmp ) {
845845 // Check the entire regions even if the first bytes of the buffers are
@@ -851,7 +851,7 @@ int MemcmpInterceptorCommon(void *ctx,
851851 unsigned char c1 = 0 , c2 = 0 ;
852852 const unsigned char *s1 = (const unsigned char *)a1;
853853 const unsigned char *s2 = (const unsigned char *)a2;
854- uptr i;
854+ usize i;
855855 for (i = 0 ; i < size; i++) {
856856 c1 = s1[i];
857857 c2 = s2[i];
@@ -871,7 +871,7 @@ int MemcmpInterceptorCommon(void *ctx,
871871 return result;
872872}
873873
874- INTERCEPTOR (int , memcmp, const void *a1, const void *a2, uptr size) {
874+ INTERCEPTOR (int , memcmp, const void *a1, const void *a2, usize size) {
875875 if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)
876876 return internal_memcmp (a1, a2, size);
877877 void *ctx;
@@ -885,7 +885,7 @@ INTERCEPTOR(int, memcmp, const void *a1, const void *a2, uptr size) {
885885#endif
886886
887887#if SANITIZER_INTERCEPT_BCMP
888- INTERCEPTOR (int , bcmp, const void *a1, const void *a2, uptr size) {
888+ INTERCEPTOR (int , bcmp, const void *a1, const void *a2, usize size) {
889889 if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)
890890 return internal_memcmp (a1, a2, size);
891891 void *ctx;
@@ -914,7 +914,7 @@ INTERCEPTOR(void*, memchr, const void *s, int c, SIZE_T n) {
914914#else
915915 void *res = REAL (memchr)(s, c, n);
916916#endif
917- uptr len = res ? (char *)res - (const char *)s + 1 : n;
917+ usize len = res ? (char *)res - (const char *)s + 1 : n;
918918 COMMON_INTERCEPTOR_READ_RANGE (ctx, s, len);
919919 return res;
920920}
@@ -1138,7 +1138,7 @@ INTERCEPTOR(SSIZE_T, write, int fd, void *ptr, SIZE_T count) {
11381138#endif
11391139
11401140#if SANITIZER_INTERCEPT_FWRITE
1141- INTERCEPTOR (SIZE_T, fwrite, const void *p, uptr size, uptr nmemb, void *file) {
1141+ INTERCEPTOR (SIZE_T, fwrite, const void *p, usize size, usize nmemb, void *file) {
11421142 // libc file streams can call user-supplied functions, see fopencookie.
11431143 void *ctx;
11441144 COMMON_INTERCEPTOR_ENTER (ctx, fwrite, p, size, nmemb, file);
@@ -6534,12 +6534,12 @@ static void MlockIsUnsupported() {
65346534 SanitizerToolName);
65356535}
65366536
6537- INTERCEPTOR (int , mlock, const void *addr, uptr len) {
6537+ INTERCEPTOR (int , mlock, const void *addr, usize len) {
65386538 MlockIsUnsupported ();
65396539 return 0 ;
65406540}
65416541
6542- INTERCEPTOR (int , munlock, const void *addr, uptr len) {
6542+ INTERCEPTOR (int , munlock, const void *addr, usize len) {
65436543 MlockIsUnsupported ();
65446544 return 0 ;
65456545}
0 commit comments