Bug 1009624 - Startup crash in nsXULPrototypeDocument::GetCompilationGlobal(). r=bholley, a=sledru
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 14 May 2014 21:00:33 +0300
changeset 199211 f961ef4e1c14db8d72140348a6fb9f99e48fef7d
parent 199210 5853db2e84752b517b09a8362908bec8b6115f04
child 199212 81edb9d02cccb4360aeaa47b5dabfa4d09d20090
push id3624
push userasasaki@mozilla.com
push dateMon, 09 Jun 2014 21:49:01 +0000
treeherdermozilla-beta@b1a5da15899a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley, sledru
bugs1009624
milestone31.0a2
Bug 1009624 - Startup crash in nsXULPrototypeDocument::GetCompilationGlobal(). r=bholley, a=sledru
content/xul/content/src/nsXULElement.cpp
content/xul/document/src/XULDocument.cpp
--- a/content/xul/content/src/nsXULElement.cpp
+++ b/content/xul/content/src/nsXULElement.cpp
@@ -2623,17 +2623,17 @@ nsresult
 nsXULPrototypeScript::Compile(JS::SourceBufferHolder& aSrcBuf,
                               nsIURI* aURI,
                               uint32_t aLineNo,
                               nsIDocument* aDocument,
                               nsXULPrototypeDocument* aProtoDoc,
                               nsIOffThreadScriptReceiver *aOffThreadReceiver /* = nullptr */)
 {
     // We'll compile the script in the compilation scope.
-    MOZ_ASSERT(aProtoDoc);
+    NS_ENSURE_STATE(aProtoDoc);
     NS_ENSURE_TRUE(xpc::GetCompilationScope(), NS_ERROR_UNEXPECTED);
     AutoSafeJSContext cx;
     JSAutoCompartment ac(cx, xpc::GetCompilationScope());
 
     nsAutoCString urlspec;
     nsContentUtils::GetWrapperSafeScriptFilename(aDocument, aURI, urlspec);
 
     // Ok, compile it to create a prototype script object!
--- a/content/xul/document/src/XULDocument.cpp
+++ b/content/xul/document/src/XULDocument.cpp
@@ -3546,17 +3546,17 @@ XULDocument::OnStreamComplete(nsIStreamL
             JS::SourceBufferHolder srcBuf(mOffThreadCompileStringBuf,
                                           mOffThreadCompileStringLength,
                                           JS::SourceBufferHolder::GiveOwnership);
             mOffThreadCompileStringBuf = nullptr;
             mOffThreadCompileStringLength = 0;
 
             rv = mCurrentScriptProto->Compile(srcBuf,
                                               uri, 1, this,
-                                              mCurrentPrototype,
+                                              mMasterPrototype,
                                               this);
             if (NS_SUCCEEDED(rv) && !mCurrentScriptProto->GetScriptObject()) {
                 // We will be notified via OnOffThreadCompileComplete when the
                 // compile finishes. Keep the contents of the compiled script
                 // alive until the compilation finishes.
                 mOffThreadCompiling = true;
                 // If the JS engine did not take the source buffer, then take
                 // it back here to ensure it remains alive.