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

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

Issue 556443003: Oilpan: Fix ASan instrumentation around heap object headers. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 3 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/platform/heap/Heap.cpp » ('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 07312d258e0f0ac6630af91ec587a49e7b3063b3..05e20f6ecb3cd3bf8757d002345dc8b1801a1fbf 100644
--- a/Source/platform/heap/Heap.h
+++ b/Source/platform/heap/Heap.h
@@ -1497,6 +1497,7 @@ Address HeapObjectHeader::payloadEnd()
return reinterpret_cast<Address>(this) + size();
}
+NO_SANITIZE_ADDRESS
void HeapObjectHeader::mark()
{
checkHeader();
@@ -1505,12 +1506,13 @@ void HeapObjectHeader::mark()
// Multiple threads can still read the old value and all store the
// new value. However, the new value will be the same for all of
// the threads and the end result is therefore consistent.
- // We need to unpoison/poison the header on ASAN since
- // acquireLoad/releaseStore don't have the NO_SANITIZE_ADDRESS flag.
- ASAN_UNPOISON_MEMORY_REGION(this, sizeof(this));
+#if defined(ADDRESS_SANITIZER)
zerny-chromium 2014/09/09 06:01:28 I'd prefer to avoid the code duplication by defini
Mads Ager (chromium) 2014/09/09 08:22:14 Done.
+ unsigned size = asanAcquireLoad(&m_size);
+ asanReleaseStore(&m_size, size | markBitMask);
+#else
unsigned size = acquireLoad(&m_size);
releaseStore(&m_size, size | markBitMask);
- ASAN_POISON_MEMORY_REGION(this, sizeof(this));
+#endif
}
Address FinalizedHeapObjectHeader::payload()
« no previous file with comments | « no previous file | Source/platform/heap/Heap.cpp » ('j') | Source/platform/heap/Heap.cpp » ('J')

Powered by Google App Engine
This is Rietveld 408576698