Index: content/renderer/render_view_impl.cc |
diff --git a/content/renderer/render_view_impl.cc b/content/renderer/render_view_impl.cc |
index 8240f49de3b66596a0ec355c47159fbed7828e8f..2db9ad1a3170225c077f40150ebf6de748cbe367 100644 |
--- a/content/renderer/render_view_impl.cc |
+++ b/content/renderer/render_view_impl.cc |
@@ -325,18 +325,35 @@ static WebReferrerPolicy getReferrerPolicyFromRequest( |
WebKit::WebReferrerPolicyDefault; |
} |
+// Disable optimizations so the symbol "CrashIntentionally()" does not get |
+// optimized away. We want this name to appear in the crashed callstack to |
+// make it clear what these crashes are about. |
+#if defined(COMPILER_MSVC) |
+#pragma optimize("", off) |
+MSVC_PUSH_DISABLE_WARNING(4748) |
+#endif |
+ |
+#if defined(COMPILER_GCC) |
+__attribute__((noinline)) |
Nico
2012/02/10 22:20:39
Does this work? I thought attributes go behind the
|
+#endif |
+ |
+static void CrashIntentionally() { |
+ // NOTE(shess): Crash directly rather than using NOTREACHED() so |
+ // that the signature is easier to triage in crash reports. |
+ volatile int* zero = NULL; |
+ *zero = 0; |
+} |
+ |
+#if defined(COMPILER_MSVC) |
+MSVC_POP_WARNING() |
+#pragma optimize("", on) |
+#endif |
+ |
static void MaybeHandleDebugURL(const GURL& url) { |
if (!url.SchemeIs(chrome::kChromeUIScheme)) |
return; |
if (url == GURL(chrome::kChromeUICrashURL)) { |
- // NOTE(shess): Crash directly rather than using NOTREACHED() so |
- // that the signature is easier to triage in crash reports. |
- volatile int* zero = NULL; |
- *zero = 0; |
- |
- // Just in case the compiler decides the above is undefined and |
- // optimizes it away. |
- NOTREACHED(); |
+ CrashIntentionally(); |
} else if (url == GURL(chrome::kChromeUIKillURL)) { |
base::KillProcess(base::GetCurrentProcessHandle(), 1, false); |
} else if (url == GURL(chrome::kChromeUIHangURL)) { |