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

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

Issue 1155113002: Oilpan: HeapObjectHeader::checkHeader should not allow access on orphaned pages (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 5 years, 7 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 | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/HeapAllocator.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/Heap.cpp
diff --git a/Source/platform/heap/Heap.cpp b/Source/platform/heap/Heap.cpp
index e11dbd786d2dd62638516e6d7cb23c8ec137b4da..7aa2c231efa6ed4a67de79062c776a89d35aa58f 100644
--- a/Source/platform/heap/Heap.cpp
+++ b/Source/platform/heap/Heap.cpp
@@ -605,6 +605,7 @@ bool NormalPageHeap::coalesce()
headerAddress += size;
continue;
}
+ header->checkHeader();
if (startOfGap != headerAddress)
addToFreeList(startOfGap, headerAddress - startOfGap);
@@ -658,6 +659,7 @@ bool NormalPageHeap::expandObject(HeapObjectHeader* header, size_t newSize)
// It's possible that Vector requests a smaller expanded size because
// Vector::shrinkCapacity can set a capacity smaller than the actual payload
// size.
+ header->checkHeader();
if (header->payloadSize() >= newSize)
return true;
size_t allocationSize = Heap::allocationSizeFromSize(newSize);
@@ -679,6 +681,7 @@ bool NormalPageHeap::expandObject(HeapObjectHeader* header, size_t newSize)
bool NormalPageHeap::shrinkObject(HeapObjectHeader* header, size_t newSize)
{
+ header->checkHeader();
ASSERT(header->payloadSize() > newSize);
size_t allocationSize = Heap::allocationSizeFromSize(newSize);
ASSERT(header->size() > allocationSize);
@@ -1280,6 +1283,7 @@ static bool isUninitializedMemory(void* objectPointer, size_t objectSize)
static void markPointer(Visitor* visitor, HeapObjectHeader* header)
{
+ header->checkHeader();
const GCInfo* gcInfo = Heap::gcInfo(header->gcInfoIndex());
if (gcInfo->hasVTable() && !vTableInitialized(header->payload())) {
// We hit this branch when a GC strikes before GarbageCollected<>'s
@@ -1351,6 +1355,7 @@ void NormalPage::snapshot(TracedValue* json, ThreadState::SnapshotInfo* info)
info->freeSize += header->size();
continue;
}
+ header->checkHeader();
size_t tag = info->getClassTag(Heap::gcInfo(header->gcInfoIndex()));
size_t age = header->age();
« no previous file with comments | « Source/platform/heap/Heap.h ('k') | Source/platform/heap/HeapAllocator.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698