Bug 1068163 - Turn off release-mode assertion against addon scope prototype munging. a=me
authorBobby Holley <bobbyholley@gmail.com>
Tue, 16 Sep 2014 22:06:51 +0200
changeset 228659 55b46de164d89840db5c3b7121213ebcce4dd3d9
parent 228658 3b7921328fc126999fa908e6379cbd555d028c50
child 228688 543f57ab6a44ad1b206252a7eb857e0cbec4bb35
push id4187
push userbhearsum@mozilla.com
push dateFri, 28 Nov 2014 15:29:12 +0000
treeherdermozilla-beta@f23cc6a30c11 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersme
bugs1068163
milestone35.0a1
first release with
nightly linux32
55b46de164d8 / 35.0a1 / 20140916133137 / files
nightly linux64
55b46de164d8 / 35.0a1 / 20140916133139 / files
nightly mac
55b46de164d8 / 35.0a1 / 20140916133141 / files
nightly win32
55b46de164d8 / 35.0a1 / 20140916133140 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 1068163 - Turn off release-mode assertion against addon scope prototype munging. a=me
js/xpconnect/src/XPCJSRuntime.cpp
--- a/js/xpconnect/src/XPCJSRuntime.cpp
+++ b/js/xpconnect/src/XPCJSRuntime.cpp
@@ -582,17 +582,23 @@ AddonWindowOrNull(JSObject *aObj)
         return nullptr;
 
     JSObject *global = js::GetGlobalForObjectCrossCompartment(aObj);
     JSObject *proto = js::GetPrototypeNoProxy(global);
 
     // Addons could theoretically change the prototype of the addon scope, but
     // we pretty much just want to crash if that happens so that we find out
     // about it and get them to change their code.
-    MOZ_RELEASE_ASSERT(js::IsCrossCompartmentWrapper(proto));
+    //
+    // XXXbholley - Except unfortunately, that breaks the world right now. See
+    // bug 1068163.
+    if (!js::IsCrossCompartmentWrapper(proto)) {
+        NS_WARNING("An addon modified its global prototype - it likely won't work right!");
+        return nullptr;
+    }
     JSObject *mainGlobal = js::UncheckedUnwrap(proto, /* stopAtOuter = */ false);
     MOZ_RELEASE_ASSERT(JS_IsGlobalObject(mainGlobal));
 
     return WindowOrNull(mainGlobal);
 }
 
 }