summaryrefslogtreecommitdiff
path: root/ptr_chck.c
diff options
context:
space:
mode:
Diffstat (limited to 'ptr_chck.c')
-rw-r--r--ptr_chck.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/ptr_chck.c b/ptr_chck.c
index 8b760af0..a4298a81 100644
--- a/ptr_chck.c
+++ b/ptr_chck.c
@@ -123,6 +123,11 @@ GC_API void * GC_CALL GC_is_valid_displacement(void *p)
word sz;
if (!EXPECT(GC_is_initialized, TRUE)) GC_init();
+
+ /* A quick check to avoid TSan report about the data race */
+ /* between GC_find_header() and GC_remove_counts(). */
+ if (NULL == p) return NULL;
+
hhdr = HDR((word)p);
if (hhdr == 0) return(p);
h = HBLKPTR(p);