diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h --- a/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h +++ b/compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h @@ -139,8 +139,13 @@ typedef unsigned long long uptr; typedef signed long long sptr; #else +# if (SANITIZER_WORDSIZE == 64) typedef unsigned long uptr; typedef signed long sptr; +# else +typedef unsigned int uptr; +typedef signed int sptr; +# endif #endif // defined(_WIN64) #if defined(__x86_64__) // Since x32 uses ILP32 data model in 64-bit hardware mode, we must use @@ -182,7 +187,7 @@ #endif typedef u64 OFF64_T; -#if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC +#if (SANITIZER_WORDSIZE == 64) typedef uptr operator_new_size_type; #else # if defined(__s390__) && !defined(__s390x__) diff --git a/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp b/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp --- a/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp +++ b/compiler-rt/lib/sanitizer_common/tests/sanitizer_bitvector_test.cpp @@ -71,7 +71,7 @@ #if defined(_WIN64) fprintf(stderr, "%llu ", *it); #else - fprintf(stderr, "%lu ", *it); + fprintf(stderr, "%zu ", *it); #endif } fprintf(stderr, "\n");