Bug 1518075 - Fix rooting hazard r=me on a CLOSED TREE
authorJon Coppeard <jcoppeard@mozilla.com>
Mon, 21 Jan 2019 14:26:24 +0000
changeset 514714 b1f8fe42b1a80800368724ebbff8e5097e632511
parent 514713 d9ae827234990ad8ce27a2337df9dbc9dc578b05
child 514715 95fee3425c550b542894e545a365b9e15cd59d7e
child 514735 44369796f148630ff496be99f77a5eeea41c7d23
push id1953
push userffxbld-merge
push dateMon, 11 Mar 2019 12:10:20 +0000
treeherdermozilla-release@9c35dcbaa899 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1518075
milestone66.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 1518075 - Fix rooting hazard r=me on a CLOSED TREE
dom/base/nsGlobalWindowInner.cpp
--- a/dom/base/nsGlobalWindowInner.cpp
+++ b/dom/base/nsGlobalWindowInner.cpp
@@ -6001,17 +6001,17 @@ bool nsGlobalWindowInner::RunTimeoutHand
       options.setFileAndLine(filename, lineNo);
       options.setNoScriptRval(true);
       JS::Rooted<JSObject*> global(aes.cx(), FastGetGlobalJSObject());
       nsresult rv;
       {
         nsJSUtils::ExecutionContext exec(aes.cx(), global);
         rv = exec.Compile(options, handler->GetHandlerText());
 
-        JSScript* script = exec.MaybeGetScript();
+        JS::Rooted<JSScript*> script(aes.cx(), exec.MaybeGetScript());
         if (script) {
           LoadedScript* initiatingScript = handler->GetInitiatingScript();
           if (initiatingScript) {
             initiatingScript->AssociateWithScript(script);
           }
 
           rv = exec.ExecScript();
         }