Bug 1009624 - startup crash in nsXULPrototypeDocument::GetCompilationGlobal() , r=bholley
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 14 May 2014 21:00:33 +0300
changeset 183287 b2d759db4dcc3eda0ef97ee3ef7caa9711f343cd
parent 183286 59689ead31dea9f8e98b5b7658f93d65137c7083
child 183288 7c88afa3e9d9f3d566d0c002667bd6d1da063103
push id26789
push userkwierso@gmail.com
push dateThu, 15 May 2014 22:59:59 +0000
treeherdermozilla-central@58c5a3427997 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbholley
bugs1009624
milestone32.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 1009624 - startup crash in nsXULPrototypeDocument::GetCompilationGlobal() , r=bholley
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.