Bug 717173 - 'Crash @ JS_ReportPendingException'. r=khuey.
authorBen Turner <bent.mozilla@gmail.com>
Thu, 12 Jan 2012 08:55:44 -0800
changeset 84353 b3b6bca8a02a3d34dd02491e2b5e84c73ce8f8b2
parent 84352 d7abb1f2efc8f9a84f83b609020b5ca8c61928dd
child 84354 cd17d9409fda69fa6abefea715ab30935de13dad
push id21842
push usermak77@bonardo.net
push dateFri, 13 Jan 2012 08:56:37 +0000
treeherdermozilla-central@8d4638feec54 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskhuey
bugs717173
milestone12.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 717173 - 'Crash @ JS_ReportPendingException'. r=khuey.
dom/workers/WorkerPrivate.cpp
--- a/dom/workers/WorkerPrivate.cpp
+++ b/dom/workers/WorkerPrivate.cpp
@@ -1523,17 +1523,17 @@ WorkerRunnable::PreDispatch(JSContext* a
   if (mTarget == ParentThread) {
     aWorkerPrivate->AssertIsOnWorkerThread();
   }
   else {
     aWorkerPrivate->AssertIsOnParentThread();
   }
 #endif
 
-  if (mBusyBehavior == ModifyBusyCount) {
+  if (mBusyBehavior == ModifyBusyCount && aCx) {
     return aWorkerPrivate->ModifyBusyCount(aCx, true);
   }
 
   return true;
 }
 
 bool
 WorkerRunnable::Dispatch(JSContext* aCx)
@@ -1611,17 +1611,17 @@ WorkerRunnable::PostDispatch(JSContext* 
   if (mTarget == ParentThread) {
     aWorkerPrivate->AssertIsOnWorkerThread();
   }
   else {
     aWorkerPrivate->AssertIsOnParentThread();
   }
 #endif
 
-  if (!aDispatchResult) {
+  if (!aDispatchResult && aCx) {
     if (mBusyBehavior == ModifyBusyCount) {
       aWorkerPrivate->ModifyBusyCount(aCx, false);
     }
     JS_ReportPendingException(aCx);
   }
 }
 
 NS_IMETHODIMP