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

Unified Diff: third_party/WebKit/Source/platform/heap/HeapTest.cpp

Issue 2464273002: Fix ThreadHeap::isHeapObjectAlive(const T*& ptr) stack overflow. (Closed)
Patch Set: Delete comments Created 4 years, 1 month 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 | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/platform/heap/HeapTest.cpp
diff --git a/third_party/WebKit/Source/platform/heap/HeapTest.cpp b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
index c3d0aa58ecde03ca0c071339ef8076e59a984131..10bcac901bb2204a7d9acabe1f56e30a9a8f49b3 100644
--- a/third_party/WebKit/Source/platform/heap/HeapTest.cpp
+++ b/third_party/WebKit/Source/platform/heap/HeapTest.cpp
@@ -3922,6 +3922,26 @@ TEST(HeapTest, Comparisons) {
EXPECT_TRUE(barPersistent == fooPersistent);
}
+TEST(HeapTest, CheckConstObjectAlive) {
+ SimpleObject* object = SimpleObject::create();
+ const SimpleObject* constObject = object;
+
+ EXPECT_FALSE(ThreadHeap::isHeapObjectAlive(object));
+ EXPECT_FALSE(ThreadHeap::isHeapObjectAlive(constObject));
+
+ // {
+ // TestGCScope scope(BlinkGC::HeapPointersOnStack);
+ // ThreadHeap& heap = ThreadState::current()->heap();
+ // CountingVisitor visitor(ThreadState::current());
+
+ // Address objectAddress = reinterpret_cast<Address>(object);
+ // EXPECT_TRUE(heap.checkAndMarkPointer(&visitor, objectAddress));
+
+ // EXPECT_TRUE(ThreadHeap::isHeapObjectAlive(object));
+ // EXPECT_TRUE(ThreadHeap::isHeapObjectAlive(constObject));
+ // }
haraken 2016/11/02 01:12:47 Can we remove this comment? It's not worth adding
chcunningham 2016/11/02 01:19:06 Sorry, I mean to uncomment it actually, but it doe
haraken 2016/11/02 01:22:30 Ah, actually this test doesn't make sense in the f
+}
+
TEST(HeapTest, CheckAndMarkPointer) {
ThreadHeap& heap = ThreadState::current()->heap();
clearOutOldGarbage();
« no previous file with comments | « third_party/WebKit/Source/platform/heap/Heap.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698