Bug 931048 - fix NULL crash on OOM in handleAsmJSWorkload (r=sstangl)
authorLuke Wagner <luke@mozilla.com>
Fri, 25 Oct 2013 13:33:49 -0500
changeset 166087 8e4f531f68d290b34eb88604fc7c514e02a5bdd5
parent 166086 a41ce04d632d3395b78f4933e124e698bbe1db84
child 166088 f4bc5478669bfd38b13374ef52e13740863802f9
push id3066
push userakeybl@mozilla.com
push dateMon, 09 Dec 2013 19:58:46 +0000
treeherdermozilla-beta@a31a0dce83aa [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerssstangl
bugs931048
milestone27.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 931048 - fix NULL crash on OOM in handleAsmJSWorkload (r=sstangl)
js/src/jsworkers.cpp
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -653,19 +653,19 @@ WorkerThread::handleAsmJSWorkload(Worker
         asmData->compileTime = (after - before) / PRMJ_USEC_PER_MSEC;
 
         success = true;
     } while(0);
     state.lock();
 
     // On failure, signal parent for harvesting in CancelOutstandingJobs().
     if (!success) {
-        asmData = nullptr;
         state.noteAsmJSFailure(asmData->func);
         state.notifyAll(WorkerThreadState::CONSUMER);
+        asmData = nullptr;
         return;
     }
 
     // On success, move work to the finished list.
     state.asmJSFinishedList.append(asmData);
     asmData = nullptr;
 
     // Notify the main thread in case it's blocked waiting for a LifoAlloc.