Bug 658909 - Initialize the same fields in both XPCCallContext constructors. r=mrbkap
authorBobby Holley <bobbyholley@gmail.com>
Thu, 21 Mar 2013 08:20:42 -0700
changeset 125804 2b4be35b1837eaa59bbf7c2dedd535b89cb2c451
parent 125803 49b621f262f1b54c8905d9ac1ff2737438aa677e
child 125805 b20ec46f32c6da6a038f75b8d9558ede4b86333b
push id24464
push useremorley@mozilla.com
push dateFri, 22 Mar 2013 14:00:12 +0000
treeherdermozilla-central@3825fdbcec62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersmrbkap
bugs658909
milestone22.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 658909 - Initialize the same fields in both XPCCallContext constructors. r=mrbkap This is a huge footgun. XPCCallContext is hot, but it's not too hot to be safe here. Garbage XPCWN and JSObject pointers are bad.
js/xpconnect/src/XPCCallContext.cpp
--- a/js/xpconnect/src/XPCCallContext.cpp
+++ b/js/xpconnect/src/XPCCallContext.cpp
@@ -21,17 +21,20 @@ XPCCallContext::XPCCallContext(XPCContex
                                jsval *argv      /* = nullptr    */,
                                jsval *rval      /* = nullptr    */)
     :   mState(INIT_FAILED),
         mXPC(nsXPConnect::GetXPConnect()),
         mXPCContext(nullptr),
         mJSContext(cx),
         mContextPopRequired(false),
         mDestroyJSContextInDestructor(false),
-        mCallerLanguage(callerLanguage)
+        mCallerLanguage(callerLanguage),
+        mFlattenedJSObject(nullptr),
+        mWrapper(nullptr),
+        mTearOff(nullptr)
 {
     Init(callerLanguage, callerLanguage == NATIVE_CALLER, obj, funobj,
          INIT_SHOULD_LOOKUP_WRAPPER, name, argc, argv, rval);
 }
 
 XPCCallContext::XPCCallContext(XPCContext::LangType callerLanguage,
                                JSContext* cx,
                                JSBool callBeginRequest,