Bug 1357012 - Followup: add missing ReportOutOfMemory.
☠☠ backed out by edc49fadcda2 ☠ ☠
authorShu-yu Guo <shu@rfrn.org>
Tue, 18 Apr 2017 23:34:13 -0700
changeset 565150 2eca4618f579c77f8fd3f5303b19b999fcc3a177
parent 565149 0510315b5641dbab766002a58b306eb8b880569c
child 565151 edc49fadcda2dd849cc0f90a5d6ceb8d05c079bf
push id54802
push userdgottwald@mozilla.com
push dateWed, 19 Apr 2017 15:26:27 +0000
bugs1357012
milestone55.0a1
Bug 1357012 - Followup: add missing ReportOutOfMemory.
js/src/jsscript.cpp
--- a/js/src/jsscript.cpp
+++ b/js/src/jsscript.cpp
@@ -1853,18 +1853,20 @@ ScriptSource::tryCompressOffThread(JSCon
     // When parsing off-thread, the above attempts will fail and the attempt
     // made in ParseTask::finish will succeed.
     if (!CurrentThreadCanAccessRuntime(cx->runtime()))
         return true;
 
     // Heap allocate the task. It will be freed upon compression
     // completing in AttachFinishedCompressedSources.
     auto task = MakeUnique<SourceCompressionTask>(cx->runtime(), this);
-    if (!task)
+    if (!task) {
+        ReportOutOfMemory(cx);
         return false;
+    }
     return EnqueueOffThreadCompression(cx, Move(task));
 }
 
 MOZ_MUST_USE bool
 ScriptSource::setCompressedSource(JSContext* cx,
                                   mozilla::UniquePtr<char[], JS::FreePolicy>&& raw,
                                   size_t rawLength,
                                   size_t sourceLength)