@@ -344,7 +344,7 @@ extern const short *_tolower_tab_;
344
344
#ifndef COMMON_INTERCEPTOR_STRNDUP_IMPL
345
345
#define COMMON_INTERCEPTOR_STRNDUP_IMPL (ctx, s, size ) \
346
346
COMMON_INTERCEPTOR_ENTER (ctx, strndup, s, size); \
347
- uptr copy_length = internal_strnlen(s, size); \
347
+ usize copy_length = internal_strnlen(s, size); \
348
348
char *new_mem = (char *)WRAP(malloc)(copy_length + 1 ); \
349
349
if (common_flags()->intercept_strndup) { \
350
350
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) {
445
445
#endif
446
446
447
447
#if SANITIZER_INTERCEPT_STRNDUP
448
- INTERCEPTOR (char *, strndup, const char *s, uptr size) {
448
+ INTERCEPTOR (char *, strndup, const char *s, usize size) {
449
449
void *ctx;
450
450
COMMON_INTERCEPTOR_STRNDUP_IMPL (ctx, s, size);
451
451
}
@@ -455,7 +455,7 @@ INTERCEPTOR(char*, strndup, const char *s, uptr size) {
455
455
#endif // SANITIZER_INTERCEPT_STRNDUP
456
456
457
457
#if SANITIZER_INTERCEPT___STRNDUP
458
- INTERCEPTOR (char *, __strndup, const char *s, uptr size) {
458
+ INTERCEPTOR (char *, __strndup, const char *s, usize size) {
459
459
void *ctx;
460
460
COMMON_INTERCEPTOR_STRNDUP_IMPL (ctx, s, size);
461
461
}
@@ -494,7 +494,7 @@ INTERCEPTOR(int, strcmp, const char *s1, const char *s2) {
494
494
void *ctx;
495
495
COMMON_INTERCEPTOR_ENTER (ctx, strcmp, s1, s2);
496
496
unsigned char c1, c2;
497
- uptr i;
497
+ usize i;
498
498
for (i = 0 ;; i++) {
499
499
c1 = (unsigned char )s1[i];
500
500
c2 = (unsigned char )s2[i];
@@ -511,23 +511,23 @@ INTERCEPTOR(int, strcmp, const char *s1, const char *s2) {
511
511
}
512
512
513
513
DECLARE_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,
515
515
int result)
516
516
517
- INTERCEPTOR(int , strncmp, const char *s1, const char *s2, uptr size) {
517
+ INTERCEPTOR(int , strncmp, const char *s1, const char *s2, usize size) {
518
518
if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)
519
519
return internal_strncmp (s1, s2, size);
520
520
void *ctx;
521
521
COMMON_INTERCEPTOR_ENTER (ctx, strncmp, s1, s2, size);
522
522
unsigned char c1 = 0 , c2 = 0 ;
523
- uptr i;
523
+ usize i;
524
524
for (i = 0 ; i < size; i++) {
525
525
c1 = (unsigned char )s1[i];
526
526
c2 = (unsigned char )s2[i];
527
527
if (c1 != c2 || c1 == ' \0 ' ) break ;
528
528
}
529
- uptr i1 = i;
530
- uptr i2 = i;
529
+ usize i1 = i;
530
+ usize i2 = i;
531
531
if (common_flags ()->strict_string_checks ) {
532
532
for (; i1 < size && s1[i1]; i1++) {}
533
533
for (; i2 < size && s2[i2]; i2++) {}
@@ -561,7 +561,7 @@ INTERCEPTOR(int, strcasecmp, const char *s1, const char *s2) {
561
561
void *ctx;
562
562
COMMON_INTERCEPTOR_ENTER (ctx, strcasecmp, s1, s2);
563
563
unsigned char c1 = 0 , c2 = 0 ;
564
- uptr i;
564
+ usize i;
565
565
for (i = 0 ;; i++) {
566
566
c1 = (unsigned char )s1[i];
567
567
c2 = (unsigned char )s2[i];
@@ -576,21 +576,21 @@ INTERCEPTOR(int, strcasecmp, const char *s1, const char *s2) {
576
576
}
577
577
578
578
DECLARE_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,
580
580
int result)
581
581
582
582
INTERCEPTOR(int , strncasecmp, const char *s1, const char *s2, SIZE_T size) {
583
583
void *ctx;
584
584
COMMON_INTERCEPTOR_ENTER (ctx, strncasecmp, s1, s2, size);
585
585
unsigned char c1 = 0 , c2 = 0 ;
586
- uptr i;
586
+ usize i;
587
587
for (i = 0 ; i < size; i++) {
588
588
c1 = (unsigned char )s1[i];
589
589
c2 = (unsigned char )s2[i];
590
590
if (CharCaseCmp (c1, c2) != 0 || c1 == ' \0 ' ) break ;
591
591
}
592
- uptr i1 = i;
593
- uptr i2 = i;
592
+ usize i1 = i;
593
+ usize i2 = i;
594
594
if (common_flags ()->strict_string_checks ) {
595
595
for (; i1 < size && s1[i1]; i1++) {}
596
596
for (; i2 < size && s2[i2]; i2++) {}
@@ -613,8 +613,8 @@ INTERCEPTOR(int, strncasecmp, const char *s1, const char *s2, SIZE_T size) {
613
613
#if SANITIZER_INTERCEPT_STRSTR || SANITIZER_INTERCEPT_STRCASESTR
614
614
static inline void StrstrCheck (void *ctx, char *r, const char *s1,
615
615
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);
618
618
COMMON_INTERCEPTOR_READ_STRING (ctx, s1, r ? r - s1 + len2 : len1 + 1 );
619
619
COMMON_INTERCEPTOR_READ_RANGE (ctx, s2, len2 + 1 );
620
620
}
@@ -758,7 +758,7 @@ INTERCEPTOR(char*, strchrnul, const char *s, int c) {
758
758
void *ctx;
759
759
COMMON_INTERCEPTOR_ENTER (ctx, strchrnul, s, c);
760
760
char *result = REAL (strchrnul)(s, c);
761
- uptr len = result - s + 1 ;
761
+ usize len = result - s + 1 ;
762
762
if (common_flags ()->intercept_strchr )
763
763
COMMON_INTERCEPTOR_READ_STRING (ctx, s, len);
764
764
return result;
@@ -833,13 +833,13 @@ INTERCEPTOR(char *, strpbrk, const char *s1, const char *s2) {
833
833
834
834
#if SANITIZER_INTERCEPT_MEMCMP
835
835
DECLARE_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,
837
837
int result)
838
838
839
839
// Common code for `memcmp` and `bcmp`.
840
840
int 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) {
843
843
if (common_flags ()->intercept_memcmp ) {
844
844
if (common_flags ()->strict_memcmp ) {
845
845
// Check the entire regions even if the first bytes of the buffers are
@@ -851,7 +851,7 @@ int MemcmpInterceptorCommon(void *ctx,
851
851
unsigned char c1 = 0 , c2 = 0 ;
852
852
const unsigned char *s1 = (const unsigned char *)a1;
853
853
const unsigned char *s2 = (const unsigned char *)a2;
854
- uptr i;
854
+ usize i;
855
855
for (i = 0 ; i < size; i++) {
856
856
c1 = s1[i];
857
857
c2 = s2[i];
@@ -871,7 +871,7 @@ int MemcmpInterceptorCommon(void *ctx,
871
871
return result;
872
872
}
873
873
874
- INTERCEPTOR (int , memcmp, const void *a1, const void *a2, uptr size) {
874
+ INTERCEPTOR (int , memcmp, const void *a1, const void *a2, usize size) {
875
875
if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)
876
876
return internal_memcmp (a1, a2, size);
877
877
void *ctx;
@@ -885,7 +885,7 @@ INTERCEPTOR(int, memcmp, const void *a1, const void *a2, uptr size) {
885
885
#endif
886
886
887
887
#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) {
889
889
if (COMMON_INTERCEPTOR_NOTHING_IS_INITIALIZED)
890
890
return internal_memcmp (a1, a2, size);
891
891
void *ctx;
@@ -914,7 +914,7 @@ INTERCEPTOR(void*, memchr, const void *s, int c, SIZE_T n) {
914
914
#else
915
915
void *res = REAL (memchr)(s, c, n);
916
916
#endif
917
- uptr len = res ? (char *)res - (const char *)s + 1 : n;
917
+ usize len = res ? (char *)res - (const char *)s + 1 : n;
918
918
COMMON_INTERCEPTOR_READ_RANGE (ctx, s, len);
919
919
return res;
920
920
}
@@ -1138,7 +1138,7 @@ INTERCEPTOR(SSIZE_T, write, int fd, void *ptr, SIZE_T count) {
1138
1138
#endif
1139
1139
1140
1140
#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) {
1142
1142
// libc file streams can call user-supplied functions, see fopencookie.
1143
1143
void *ctx;
1144
1144
COMMON_INTERCEPTOR_ENTER (ctx, fwrite, p, size, nmemb, file);
@@ -6534,12 +6534,12 @@ static void MlockIsUnsupported() {
6534
6534
SanitizerToolName);
6535
6535
}
6536
6536
6537
- INTERCEPTOR (int , mlock, const void *addr, uptr len) {
6537
+ INTERCEPTOR (int , mlock, const void *addr, usize len) {
6538
6538
MlockIsUnsupported ();
6539
6539
return 0 ;
6540
6540
}
6541
6541
6542
- INTERCEPTOR (int , munlock, const void *addr, uptr len) {
6542
+ INTERCEPTOR (int , munlock, const void *addr, usize len) {
6543
6543
MlockIsUnsupported ();
6544
6544
return 0 ;
6545
6545
}
0 commit comments