Bug 1530643 - Check for allocation failure when initialising sweep actions r=sfink
authorJon Coppeard <jcoppeard@mozilla.com>
Thu, 28 Feb 2019 16:38:48 +0000
changeset 519627 70b353cfbbf301b0175d6b36a957fd49479a5b2d
parent 519626 18bf7cf021184952bcb7b614734a8c59832ebd15
child 519628 1edf55d690f2deed93a506589c4053a962f0758e
push id10862
push userffxbld-merge
push dateMon, 11 Mar 2019 13:01:11 +0000
treeherdermozilla-beta@a2e7f5c935da [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssfink
bugs1530643
milestone67.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 1530643 - Check for allocation failure when initialising sweep actions r=sfink
js/src/gc/GC.cpp
js/src/jit-test/tests/gc/bug-1530643.js
--- a/js/src/gc/GC.cpp
+++ b/js/src/gc/GC.cpp
@@ -6267,16 +6267,19 @@ class SweepActionSequence final : public
 
   ActionVector actions;
   typename Iter::State iterState;
 
  public:
   bool init(UniquePtr<Action>* acts, size_t count) {
     for (size_t i = 0; i < count; i++) {
       auto& action = acts[i];
+      if (!action) {
+        return false;
+      }
       if (action->shouldSkip()) {
         continue;
       }
       if (!actions.emplaceBack(std::move(action))) {
         return false;
       }
     }
     return true;
new file mode 100644
--- /dev/null
+++ b/js/src/jit-test/tests/gc/bug-1530643.js
@@ -0,0 +1,3 @@
+// |jit-test| skip-if: !('oomAtAllocation' in this) || helperThreadCount() === 0
+oomAtAllocation(11, 11);
+evalInWorker("");