Bug 1475515 - Remove member initialization for union Extra::mMessage. r=bz
authorAndi-Bogdan Postelnicu <bpostelnicu@mozilla.com>
Fri, 13 Jul 2018 14:39:12 +0300
changeset 426595 03ecdc85a126
parent 426594 3719d445438c
child 426596 ae6e73727685
push id34276
push userncsoregi@mozilla.com
push dateSat, 14 Jul 2018 09:41:08 +0000
treeherdermozilla-central@04dd259d71db [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbz
bugs1475515
milestone63.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 1475515 - Remove member initialization for union Extra::mMessage. r=bz MozReview-Commit-ID: GgJyXg5KxQm
dom/bindings/ErrorResult.h
--- a/dom/bindings/ErrorResult.h
+++ b/dom/bindings/ErrorResult.h
@@ -504,33 +504,33 @@ private:
   //                                               on us.
   nsresult mResult;
 
   struct Message;
   struct DOMExceptionInfo;
   union Extra {
     // mMessage is set by ThrowErrorWithMessage and reported (and deallocated)
     // by SetPendingExceptionWithMessage.
+    MOZ_INIT_OUTSIDE_CTOR
     Message* mMessage; // valid when IsErrorWithMessage()
 
     // mJSException is set (and rooted) by ThrowJSException and reported (and
     // unrooted) by SetPendingJSException.
+    MOZ_INIT_OUTSIDE_CTOR
     JS::Value mJSException; // valid when IsJSException()
 
     // mDOMExceptionInfo is set by ThrowDOMException and reported (and
     // deallocated) by SetPendingDOMException.
+    MOZ_INIT_OUTSIDE_CTOR
     DOMExceptionInfo* mDOMExceptionInfo; // valid when IsDOMException()
 
     // |mJSException| has a non-trivial constructor and therefore MUST be
     // placement-new'd into existence.
     MOZ_PUSH_DISABLE_NONTRIVIAL_UNION_WARNINGS
-    Extra()
-      : mMessage(nullptr)
-    {
-    }
+    Extra() {}
     MOZ_POP_DISABLE_NONTRIVIAL_UNION_WARNINGS
   } mExtra;
 
   Message* InitMessage(Message* aMessage) {
     // The |new| here switches the active arm of |mExtra|, from the compiler's
     // point of view.  Mere assignment *won't* necessarily do the right thing!
     new (&mExtra.mMessage) Message*(aMessage);
     return mExtra.mMessage;