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

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

Issue 455363002: Oilpan: fix tracing of un-initialized part objects during conservative GCs. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 4 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/Visitor.h » ('j') | Source/platform/heap/Visitor.h » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/platform/heap/HeapTest.cpp
diff --git a/Source/platform/heap/HeapTest.cpp b/Source/platform/heap/HeapTest.cpp
index 1aafc8a11ed9fe2206c0b5e1b1d344df71588f18..488cc164eca77464018def6da3db5c4a398fdee8 100644
--- a/Source/platform/heap/HeapTest.cpp
+++ b/Source/platform/heap/HeapTest.cpp
@@ -5030,4 +5030,30 @@ TEST(HeapTest, TraceIfNeeded)
}
}
+static bool allocateAndReturnBool()
+{
+ Heap::collectGarbage(ThreadState::HeapPointersOnStack);
+ return true;
+}
+
+class PartObjectWithVirtualMethod {
+public:
+ virtual void trace(Visitor*) { }
+};
+
+class ObjectWithVirtualPartObject : public GarbageCollected<ObjectWithVirtualPartObject> {
+public:
+ ObjectWithVirtualPartObject() : m_dummy(allocateAndReturnBool()) { }
+ void trace(Visitor* visitor) { visitor->trace(m_part); }
+private:
+ bool m_dummy;
+ PartObjectWithVirtualMethod m_part;
+};
+
+TEST(HeapTest, PartObjectWithVirtualMethod)
+{
+ ObjectWithVirtualPartObject* object = new ObjectWithVirtualPartObject();
+ EXPECT_TRUE(object);
+}
+
} // namespace blink
« no previous file with comments | « no previous file | Source/platform/heap/Visitor.h » ('j') | Source/platform/heap/Visitor.h » ('J')

Powered by Google App Engine
This is Rietveld 408576698