Bug 1512162: Followup: narrow non-stack-protected window for XPConnect on ppc64le. r=bhollley
authorCameron Kaiser <spectre@floodgap.com>
Thu, 13 Dec 2018 09:14:53 -0800
changeset 450605 f5ff59b1aaebeea896309239751485c05a11c1c2
parent 450530 5142cc07565a31b3eac66aa435ca236f7d3a3fe6
child 450606 4c0f7afe671282b23fe272779115746736e823d6
push id35208
push usercsabou@mozilla.com
push dateSat, 15 Dec 2018 02:48:07 +0000
treeherdermozilla-central@d86d184dc7d6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbhollley
bugs1512162
milestone66.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 1512162: Followup: narrow non-stack-protected window for XPConnect on ppc64le. r=bhollley
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