Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(1071)

Unified Diff: Source/platform/heap/Heap.h

Issue 1259893002: Fix FreeList::zapFreedMemory to fail "use-of-uninitialized-value" on MSAN (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: PS4 without __msan_[un]poison Created 5 years, 5 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/wtf/AddressSanitizer.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.h
diff --git a/Source/platform/heap/Heap.h b/Source/platform/heap/Heap.h
index 2100b6ef2ae2681c330e16c85606fe0d3231d0df..0a5cdbde6459496027a62956e27922a449e3e032 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -78,7 +78,12 @@ const uint8_t reuseForbiddenZapValue = 0x2c;
// memory is zeroed out when the memory is reused in Heap::allocateObject().
// In production builds, memory is not zapped (for performance). The memory
// is just zeroed out when it is added to the free list.
-#if ENABLE(ASSERT) || defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER)
+#if defined(MEMORY_SANITIZER)
+#define SET_MEMORY_INACCESSIBLE(address, size) \
+ FreeList::zapFreedMemory(address, size);
Alexander Potapenko 2015/07/29 13:39:42 Please add a TODO here indicating that we actually
kojii 2015/07/29 14:30:06 Done.
+#define SET_MEMORY_ACCESSIBLE(address, size) \
+ memset((address), 0, (size))
+#elif ENABLE(ASSERT) || defined(LEAK_SANITIZER) || defined(ADDRESS_SANITIZER)
#define SET_MEMORY_INACCESSIBLE(address, size) \
FreeList::zapFreedMemory(address, size); \
ASAN_POISON_MEMORY_REGION(address, size)
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/wtf/AddressSanitizer.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698