Bug 1315946 - Make heap checking zeal mode work again r=lth
authorJon Coppeard <jcoppeard@mozilla.com>
Wed, 09 Nov 2016 10:48:41 +0000
changeset 348578 b1d62e7171efc9d8ec596456399b2d35737d865b
parent 348577 e9d203fbb3f31f66311b2c9f731dd475b5470c92
child 348579 53b841d7ad4dbcabd43d080c8837a0ea402fce31
push id10298
push userraliiev@mozilla.com
push dateMon, 14 Nov 2016 12:33:03 +0000
treeherdermozilla-aurora@7e29173b1641 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerslth
bugs1315946
milestone52.0a1
Bug 1315946 - Make heap checking zeal mode work again r=lth
js/src/gc/Verifier.cpp
js/src/jit-test/tests/gc/bug-1315946.js
--- a/js/src/gc/Verifier.cpp
+++ b/js/src/gc/Verifier.cpp
@@ -549,13 +549,13 @@ CheckHeapTracer::check(AutoLockForExclus
     MOZ_RELEASE_ASSERT(failures == 0);
 }
 
 void
 js::gc::CheckHeapAfterGC(JSRuntime* rt)
 {
     AutoTraceSession session(rt, JS::HeapState::Tracing);
     CheckHeapTracer tracer(rt);
-    if (!tracer.init())
+    if (tracer.init())
         tracer.check(session.lock);
 }
 
 #endif /* JSGC_HASH_TABLE_CHECKS */
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/gc/bug-1315946.js
@@ -0,0 +1,14 @@
+if (!('oomTest' in this))
+    quit();
+
+// Don't run a full oomTest because it takes ages - a few iterations are
+// sufficient to trigger the bug.
+let i = 0;
+
+oomTest(Function(`
+    if (i < 10) {
+        i++;
+        gczeal(15,1);
+        foo;
+    }
+`));