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 167039 8e4f531f68d290b34eb88604fc7c514e02a5bdd5
parent 167038 a41ce04d632d3395b78f4933e124e698bbe1db84
child 167040 f4bc5478669bfd38b13374ef52e13740863802f9
push id428
push userbbajaj@mozilla.com
push dateTue, 28 Jan 2014 00:16:25 +0000
treeherdermozilla-release@cd72a7ff3a75 [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.