Index: Source/platform/heap/Heap.cpp |
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp |
index 0091151e14ce57de5b7d2477ec6d7e37239baf0e..6f8949b1c471af3e5899a0b5fd9cb4be6ac68e48 100644 |
--- a/Source/platform/heap/Heap.cpp |
+++ b/Source/platform/heap/Heap.cpp |
@@ -683,11 +683,18 @@ void ThreadHeap<Header>::getScannedStats(HeapStats& scannedStats) |
} |
#endif |
+// STRICT_ASAN_FINALIZATION_CHECKING turns on poisoning of all objects during |
+// sweeping to catch cases where dead objects touch eachother. This is not |
+// turned on by default because it also triggers for cases that are safe. |
+// Examples of such safe cases are context life cycle observers and timers |
+// embedded in garbage collected objects. |
+#define STRICT_ASAN_FINALIZATION_CHECKING 0 |
+ |
template<typename Header> |
void ThreadHeap<Header>::sweep() |
{ |
ASSERT(isConsistentForGC()); |
-#if defined(ADDRESS_SANITIZER) |
+#if defined(ADDRESS_SANITIZER) && STRICT_ASAN_FINALIZATION_CHECKING |
// When using ASAN do a pre-sweep where all unmarked objects are poisoned before |
// calling their finalizer methods. This can catch the cases where one objects |
// finalizer tries to modify another object as part of finalization. |