Skip to content

Commit

Permalink
Revert "[sanitizer] Fix MAC build after D108163"
Browse files Browse the repository at this point in the history
  • Loading branch information
vitalybuka committed Aug 16, 2021
1 parent eec3495 commit 3a05af1
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
15 changes: 4 additions & 11 deletions compiler-rt/lib/sanitizer_common/sanitizer_internal_defs.h
Expand Up @@ -139,13 +139,8 @@ namespace __sanitizer {
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
Expand Down Expand Up @@ -187,17 +182,15 @@ typedef uptr OFF_T;
#endif
typedef u64 OFF64_T;

#if (SANITIZER_WORDSIZE == 64)
#if (SANITIZER_WORDSIZE == 64) || SANITIZER_MAC
typedef uptr operator_new_size_type;
#else
# if defined(__s390__) && !defined(__s390x__)
# if defined(__s390__) && !defined(__s390x__)
// Special case: 31-bit s390 has unsigned long as size_t.
typedef unsigned long operator_new_size_type;
# elif SANITIZER_MAC
typedef unsigned long operator_new_size_type;
# else
# else
typedef u32 operator_new_size_type;
# endif
# endif
#endif

typedef u64 tid_t;
Expand Down
2 changes: 1 addition & 1 deletion compiler-rt/lib/sanitizer_common/sanitizer_malloc_mac.inc
Expand Up @@ -186,7 +186,7 @@ size_t __sanitizer_mz_size(malloc_zone_t* zone, const void* ptr) {

extern "C"
SANITIZER_INTERFACE_ATTRIBUTE
void *__sanitizer_mz_malloc(malloc_zone_t *zone, size_t size) {
void *__sanitizer_mz_malloc(malloc_zone_t *zone, uptr size) {
COMMON_MALLOC_ENTER();
COMMON_MALLOC_MALLOC(size);
return p;
Expand Down
Expand Up @@ -71,7 +71,7 @@ void Print(const set<uptr> &s) {
#if defined(_WIN64)
fprintf(stderr, "%llu ", *it);
#else
fprintf(stderr, "%zu ", *it);
fprintf(stderr, "%lu ", *it);
#endif
}
fprintf(stderr, "\n");
Expand Down

0 comments on commit 3a05af1

Please sign in to comment.