Bug 1244006 - Use const instead of MOZ_CONSTEXPR to avoid startup crash; r?dbaron draft
authorGregory Szorc <gps@mozilla.com>
Mon, 29 Feb 2016 18:20:07 -0800
changeset 335645 9374483823cf0489415d3be4838c09e5610e8115
parent 335409 9da51cb4974e03cdd8fa45a34086fe1033abfeaf
child 515187 18acd2f8be293e5ac191d218661ba107b2ac6687
push id11842
push usergszorc@mozilla.com
push dateTue, 01 Mar 2016 02:20:23 +0000
reviewersdbaron
bugs1244006
milestone47.0a1
Bug 1244006 - Use const instead of MOZ_CONSTEXPR to avoid startup crash; r?dbaron PGO builds on Visual Studio 2015 Update 1 did not take kindly to MOZ_CONSTEXPR in this file, causing a startup crash (for reasons I can't explain). Switching to literal "const" makes the crash go away. MozReview-Commit-ID: K1A43NIa6lG
layout/generic/nsIFrame.h
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -845,32 +845,35 @@ public:
   
   nsPoint GetPositionIgnoringScrolling();
 
   typedef AutoTArray<nsIContent*, 2> ContentArray;
   static void DestroyContentArray(ContentArray* aArray);
 
 #define NS_DECLARE_FRAME_PROPERTY_WITH_DTOR(prop, type, dtor)             \
   static const mozilla::FramePropertyDescriptor<type>* prop() {           \
-    static MOZ_CONSTEXPR auto descriptor =                                \
+    /* Use of MOZ_CONSTEXPR caused startup crashes with MSVC2015u1 PGO. */\
+    static const auto descriptor =                                        \
       mozilla::FramePropertyDescriptor<type>::NewWithDestructor<dtor>();  \
     return &descriptor;                                                   \
   }
 
 // Don't use this unless you really know what you're doing!
 #define NS_DECLARE_FRAME_PROPERTY_WITH_FRAME_IN_DTOR(prop, type, dtor)    \
   static const mozilla::FramePropertyDescriptor<type>* prop() {           \
-    static MOZ_CONSTEXPR auto descriptor = mozilla::                      \
+    /* Use of MOZ_CONSTEXPR caused startup crashes with MSVC2015u1 PGO. */\
+    static const auto descriptor = mozilla::                              \
       FramePropertyDescriptor<type>::NewWithDestructorWithFrame<dtor>();  \
     return &descriptor;                                                   \
   }
 
 #define NS_DECLARE_FRAME_PROPERTY_WITHOUT_DTOR(prop, type)                \
   static const mozilla::FramePropertyDescriptor<type>* prop() {           \
-    static MOZ_CONSTEXPR auto descriptor =                                \
+    /* Use of MOZ_CONSTEXPR caused startup crashes with MSVC2015u1 PGO. */\
+    static const auto descriptor =                                        \
       mozilla::FramePropertyDescriptor<type>::NewWithoutDestructor();     \
     return &descriptor;                                                   \
   }
 
 #define NS_DECLARE_FRAME_PROPERTY_DELETABLE(prop, type) \
   NS_DECLARE_FRAME_PROPERTY_WITH_DTOR(prop, type, DeleteValue)
 
 #define NS_DECLARE_FRAME_PROPERTY_RELEASABLE(prop, type) \