Bug 627943 - Bad ordering of exception save/wrap/restore, r=gal
☠☠ backed out by bee0e6e72ca5 ☠ ☠
authorSteve Fink <sfink@mozilla.com>
Fri, 21 Jan 2011 17:32:00 -0800
changeset 61234 e13f3b909fa222ad57ae6f3c7e7b5e1785ea1674
parent 61233 4031baed59f75e5b39c1b7ba2d86216000cfaaec
child 61235 6dcf1547ea08ef0e7c4c028fd8e7d06c701cf781
push id18277
push usercleary@mozilla.com
push dateTue, 25 Jan 2011 03:52:51 +0000
treeherdermozilla-central@7ee91bd90e7a [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgal
bugs627943
milestone2.0b10pre
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 627943 - Bad ordering of exception save/wrap/restore, r=gal
js/src/xpconnect/src/xpcwrappedjsclass.cpp
--- a/js/src/xpconnect/src/xpcwrappedjsclass.cpp
+++ b/js/src/xpconnect/src/xpcwrappedjsclass.cpp
@@ -1300,23 +1300,24 @@ nsXPCWrappedJSClass::CallMethod(nsXPCWra
         cx = ccx.GetJSContext();
     }
     else
     {
         xpcc = nsnull;
         cx = nsnull;
     }
 
+    js::AutoValueVector args(cx);
+    /* This must come before AutoScriptEvaluate */
+    JSAutoEnterCompartment ac;
     AutoScriptEvaluate scriptEval(cx);
-    js::AutoValueVector args(cx);
     ContextPrincipalGuard principalGuard(ccx);
 
     obj = thisObj = wrapper->GetJSObject();
 
-    JSAutoEnterCompartment ac;
     if (!ac.enter(ccx, obj))
         goto pre_call_clean_up;
 
     // XXX ASSUMES that retval is last arg. The xpidl compiler ensures this.
     paramCount = info->num_args;
     argc = paramCount -
         (paramCount && XPT_PD_IS_RETVAL(info->params[paramCount-1].flags) ? 1 : 0);