Bug 1183195 - Fix assertion at the start of InnerViewTable::sweepAfterMinorGC() r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 19 Aug 2015 09:50:07 +0100
changeset 258745 bb85ec539217b9d3a5e83c40538d8565d292e72b
parent 258744 35f538038395489cafccbdfe18f0f86d682d8e9d
child 258746 4dc348b4f780fdb170103c667fc092d338b39edb
push id29263
push userryanvm@gmail.com
push dateSun, 23 Aug 2015 21:18:49 +0000
treeherdermozilla-central@4ccdd06e51d7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1183195
milestone43.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1183195 - Fix assertion at the start of InnerViewTable::sweepAfterMinorGC() r=sfink
js/src/vm/ArrayBufferObject.cpp
--- a/js/src/vm/ArrayBufferObject.cpp
+++ b/js/src/vm/ArrayBufferObject.cpp
@@ -1051,18 +1051,20 @@ InnerViewTable::addView(JSContext* cx, A
             } else {
                 for (size_t i = 0; i < views.length(); i++) {
                     if (gc::IsInsideNursery(views[i]))
                         addToNursery = false;
                 }
             }
         }
 
-        if (!views.append(view))
+        if (!views.append(view)) {
+            ReportOutOfMemory(cx);
             return false;
+        }
     } else {
         if (!map.add(p, obj, ViewVector()))
             return false;
         JS_ALWAYS_TRUE(p->value().append(view));
     }
 
     if (addToNursery && !nurseryKeys.append(obj))
         nurseryKeysValid = false;
@@ -1123,17 +1125,17 @@ InnerViewTable::sweep(JSRuntime* rt)
         else if (key != e.front().key())
             e.rekeyFront(key);
     }
 }
 
 void
 InnerViewTable::sweepAfterMinorGC(JSRuntime* rt)
 {
-    MOZ_ASSERT(!nurseryKeys.empty());
+    MOZ_ASSERT(needsSweepAfterMinorGC());
 
     if (nurseryKeysValid) {
         for (size_t i = 0; i < nurseryKeys.length(); i++) {
             JSObject* key = nurseryKeys[i];
             Map::Ptr p = map.lookup(key);
             if (!p)
                 continue;