Skip to content

Commit 65a2eb0

Browse files
[sanitizer] Fix type in some Min() calls (#119248)
This is a follow-up to 6dec338 and #116957 and #119114.
1 parent af83093 commit 65a2eb0

File tree

1 file changed

+7
-7
lines changed

1 file changed

+7
-7
lines changed

compiler-rt/lib/sanitizer_common/sanitizer_common_interceptors.inc

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -520,14 +520,14 @@ INTERCEPTOR(int, strncmp, const char *s1, const char *s2, usize 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++) {}
@@ -583,14 +583,14 @@ INTERCEPTOR(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++) {}
@@ -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];

0 commit comments

Comments
 (0)