Bug 1431803 Turn __try into if(true) and __except into else in the chromium sandbox code r=bobowen,glandium
authorTom Ritter <tom@mozilla.com>
Mon, 22 Jan 2018 12:18:51 -0600
changeset 401897 c0de1027fbdab6f93e38854be19bbb936012339c
parent 401896 556d77fe66b04cfc382d559a18c941517b8b5d73
child 401898 5506a531ce36201fb5a5432cc32856e39d5ef98d
push id99456
push usershindli@mozilla.com
push dateWed, 31 Jan 2018 22:39:20 +0000
treeherdermozilla-inbound@fc36a210edd7 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbobowen, glandium
bugs1431803
milestone60.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 1431803 Turn __try into if(true) and __except into else in the chromium sandbox code r=bobowen,glandium MinGW doesn't support __try / __except. There are a few mechanisms available to hack around it and pseudo-support it, but these are untested in Firefox. What is tested (and works) is replacing them with if(true) and else. So we do that to neuter them in all places. There is only one situation where we need to actively modify the code (because it always throws an exception) and that situation is resolved in the other patch of this bug. MozReview-Commit-ID: IySnfxDlmW3
mozilla-config.h.in
--- a/mozilla-config.h.in
+++ b/mozilla-config.h.in
@@ -52,11 +52,22 @@
 /*
  * Force-include sdkdecls.h for building the chromium sandbox code.
  *
  * CHROMIUM_SANDBOX_BUILD is defined in security/sandbox/moz.build.
  * Note that this include path relies on the LOCAL_INCLUDES in that file.
  */
 #if defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN)
 #include "base/win/sdkdecls.h"
-#endif
+
+#ifdef __MINGW32__
+/*
+ * MinGW doesn't support __try / __except. There are a few mechanisms available
+ * to hack around it and pseudo-support it, but these are untested in Firefox.
+ * What is tested (and works) is replacing them with if(true) and else.
+ */
+#define __try if(true)
+#define __except(x) else
+
+#endif /* __MINGW32__ */
+#endif /* defined(CHROMIUM_SANDBOX_BUILD) && defined(XP_WIN) */
 
 #endif /* MOZILLA_CONFIG_H */