Bug 850446 - Fix NULL deref in StartOffThreadIonCompile(). r=bhackett
authorSean Stangl <sstangl@mozilla.com>
Wed, 13 Mar 2013 12:36:47 -0700
changeset 124733 896fca472831ad7e504918c62a219d393c8114e0
parent 124732 dab2619094d433c76f1a7e2d3b4a97ef9357bace
child 124734 6e8b0f074720ddb58cb8dec5ff8d0c55b6e01517
push id24433
push useremorley@mozilla.com
push dateThu, 14 Mar 2013 12:21:10 +0000
treeherdermozilla-central@96af92fa87fd [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhackett
bugs850446
milestone22.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 850446 - Fix NULL deref in StartOffThreadIonCompile(). r=bhackett
js/src/jsworkers.cpp
--- a/js/src/jsworkers.cpp
+++ b/js/src/jsworkers.cpp
@@ -25,16 +25,17 @@ js::StartOffThreadIonCompile(JSContext *
     JSRuntime *rt = cx->runtime;
     if (!rt->workerThreadState) {
         rt->workerThreadState = rt->new_<WorkerThreadState>();
         if (!rt->workerThreadState)
             return false;
         if (!rt->workerThreadState->init(rt)) {
             js_delete(rt->workerThreadState);
             rt->workerThreadState = NULL;
+            return false;
         }
     }
     WorkerThreadState &state = *cx->runtime->workerThreadState;
 
     JS_ASSERT(state.numThreads);
 
     AutoLockWorkerThreadState lock(rt);