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

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

Issue 464283002: [oilpan] Null pointers must be treated as live, since they can't be marked live by strongification (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Spelling fix 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') | no next file with comments »
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 db6eb0907dbab5c38943e551031c9fe7b4c0bb3e..63e794de907cab10110c842f7e45be98e6f11920 100644
--- a/Source/platform/heap/HeapTest.cpp
+++ b/Source/platform/heap/HeapTest.cpp
@@ -4225,6 +4225,24 @@ TEST(HeapTest, MapWithCustomWeaknessHandling2)
EXPECT_EQ(livingInt, i1->value.second);
}
+static void addElementsToWeakMap(HeapHashMap<int, WeakMember<IntWrapper> >* map)
+{
+ // Key cannot be zero in hashmap.
+ for (int i = 1; i < 11; i++)
+ map->add(i, IntWrapper::create(i));
+}
+
+// crbug.com/402426
+// If it doesn't assert a concurrent modification to the map, then it's passing.
+TEST(HeapTest, RegressNullIsStrongified)
+{
+ Persistent<HeapHashMap<int, WeakMember<IntWrapper> > > map = new HeapHashMap<int, WeakMember<IntWrapper> >();
+ addElementsToWeakMap(map);
+ HeapHashMap<int, WeakMember<IntWrapper> >::AddResult result = map->add(800, nullptr);
+ Heap::collectGarbage(ThreadState::HeapPointersOnStack);
+ result.storedValue->value = IntWrapper::create(42);
+}
+
TEST(HeapTest, Bind)
{
Closure closure = bind(&Bar::trace, Bar::create(), static_cast<Visitor*>(0));
« no previous file with comments | « no previous file | Source/platform/heap/Visitor.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698