Bug 1058168 - Tolerate a null PerThreadData runtime in runtimeIfOnOwnerThread(). r=luke, a=sledru
authorBrian Hackett <bhackett1024@gmail.com>
Tue, 26 Aug 2014 13:49:45 -0700
changeset 217702 55c9365701e5a074c490b7a10bc947de1b5e200c
parent 217701 e6ee35fe846e6d2e04842be3273c9cb71ac692af
child 217703 da558e9dcae3cad396091315751a7f4a2dc4a997
push id515
push userraliiev@mozilla.com
push dateMon, 06 Oct 2014 12:51:51 +0000
treeherdermozilla-release@267c7a481bef [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersluke, sledru
bugs1058168
milestone33.0a2
Bug 1058168 - Tolerate a null PerThreadData runtime in runtimeIfOnOwnerThread(). r=luke, a=sledru
js/src/vm/Runtime.h
--- a/js/src/vm/Runtime.h
+++ b/js/src/vm/Runtime.h
@@ -1602,17 +1602,17 @@ PerThreadData::runtimeFromMainThread()
 {
     JS_ASSERT(CurrentThreadCanAccessRuntime(runtime_));
     return runtime_;
 }
 
 inline JSRuntime *
 PerThreadData::runtimeIfOnOwnerThread()
 {
-    return CurrentThreadCanAccessRuntime(runtime_) ? runtime_ : nullptr;
+    return (runtime_ && CurrentThreadCanAccessRuntime(runtime_)) ? runtime_ : nullptr;
 }
 
 inline bool
 PerThreadData::exclusiveThreadsPresent()
 {
     return runtime_->exclusiveThreadsPresent();
 }