Bug 1512162 - Followup: narrow non-stack-protected window for XPConnect on ppc64le. r=bhollley, a=RyanVM
authorCameron Kaiser <spectre@floodgap.com>
Thu, 13 Dec 2018 09:14:53 -0800
changeset 509005 bc01e30511057c6b9b3c7c728675c016806d67b5
parent 509004 e1ec36f44f7309e240c3688e4f60665385789fb5
child 509006 23693d234e3707f419b60eac254633031ef94dd5
push id1905
push userffxbld-merge
push dateMon, 21 Jan 2019 12:33:13 +0000
treeherdermozilla-release@c2fca1944d8c [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhollley, RyanVM
bugs1512162
milestone65.0
Bug 1512162 - Followup: narrow non-stack-protected window for XPConnect on ppc64le. r=bhollley, a=RyanVM
js/xpconnect/src/XPCWrappedNative.cpp
--- a/js/xpconnect/src/XPCWrappedNative.cpp
+++ b/js/xpconnect/src/XPCWrappedNative.cpp
@@ -4,16 +4,18 @@
  * License, v. 2.0. If a copy of the MPL was not distributed with this
  * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
 
 /* Wrapper object for reflecting native xpcom objects into JavaScript. */
 
 #if(__GNUC__ && __linux__ && __PPC64__ && _LITTLE_ENDIAN)
 // Stack protection generates incorrect code currently with gcc on ppc64le
 // (bug 1512162).
+#define MOZ_GCC_STACK_PROTECTOR_DISABLED 1 // removed at end of file
+#pragma GCC push_options
 #pragma GCC optimize("no-stack-protector")
 #endif
 
 #include "xpcprivate.h"
 #include "mozilla/jsipc/CrossProcessObjectWrappers.h"
 #include "nsWrapperCacheInlines.h"
 #include "XPCLog.h"
 #include "js/MemoryFunctions.h"
@@ -1849,8 +1851,15 @@ static void DEBUG_CheckClassInfoClaims(X
       free(className);
     }
     if (contractID) {
       free(contractID);
     }
   }
 }
 #endif
+
+#if (MOZ_GCC_STACK_PROTECTOR_DISABLED)
+// Reenable stack protection in following modules, if we disabled it
+// (bug 1512162).
+#pragma GCC pop_options
+#undef MOZ_GCC_STACK_PROTECTOR_DISABLED
+#endif