summaryrefslogtreecommitdiffstats
path: root/compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc
diff options
context:
space:
mode:
Diffstat (limited to 'compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc')
-rw-r--r--compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc b/compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc
index 7fd94273c31..1366384f723 100644
--- a/compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc
+++ b/compiler-rt/lib/tsan/rtl/tsan_malloc_mac.cc
@@ -53,7 +53,8 @@ using namespace __tsan;
SCOPED_INTERCEPTOR_RAW(free, ptr); \
user_free(thr, pc, ptr)
#define COMMON_MALLOC_SIZE(ptr) \
- uptr size = user_alloc_usable_size(ptr);
+ uptr size = user_alloc_usable_size(ptr); \
+ if (size == 0) size = 1;
#define COMMON_MALLOC_FILL_STATS(zone, stats)
#define COMMON_MALLOC_REPORT_UNKNOWN_REALLOC(ptr, zone_ptr, zone_name) \
(void)zone_name; \
OpenPOWER on IntegriCloud