diff options
author | thestig <thestig@chromium.org> | 2015-09-18 17:24:41 -0700 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-09-19 00:25:11 +0000 |
commit | dbb042d40452df70509973cd5af02366d522a29f (patch) | |
tree | 5f93c2568da0da748f81b887b5013adef6bc4712 /content/ppapi_plugin | |
parent | 5403e28c9d9bfcf00b12721b6dc96c00f6d1ed24 (diff) | |
download | chromium_src-dbb042d40452df70509973cd5af02366d522a29f.zip chromium_src-dbb042d40452df70509973cd5af02366d522a29f.tar.gz chromium_src-dbb042d40452df70509973cd5af02366d522a29f.tar.bz2 |
Prevent a couple of intentional crash sites from being merged.
The linker may merge identical looking functions and this is confusing
for crash report processing.
Similar to https://crrev.com/345663
Review URL: https://codereview.chromium.org/1358633003
Cr-Commit-Position: refs/heads/master@{#349816}
Diffstat (limited to 'content/ppapi_plugin')
-rw-r--r-- | content/ppapi_plugin/ppapi_thread.cc | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/content/ppapi_plugin/ppapi_thread.cc b/content/ppapi_plugin/ppapi_thread.cc index 1618519..a5fa591 100644 --- a/content/ppapi_plugin/ppapi_thread.cc +++ b/content/ppapi_plugin/ppapi_thread.cc @@ -8,6 +8,7 @@ #include "base/command_line.h" #include "base/cpu.h" +#include "base/debug/alias.h" #include "base/debug/crash_logging.h" #include "base/files/file_util.h" #include "base/logging.h" @@ -257,7 +258,8 @@ PP_Resource PpapiThread::CreateBrowserFont( connection, instance, desc, prefs))->GetReference(); } -uint32 PpapiThread::Register(ppapi::proxy::PluginDispatcher* plugin_dispatcher) { +uint32 PpapiThread::Register( + ppapi::proxy::PluginDispatcher* plugin_dispatcher) { if (!plugin_dispatcher || plugin_dispatchers_.size() >= std::numeric_limits<uint32>::max()) { return 0; @@ -483,7 +485,13 @@ void PpapiThread::OnSetNetworkState(bool online) { void PpapiThread::OnCrash() { // Intentionally crash upon the request of the browser. - volatile int* null_pointer = NULL; + // + // Linker's ICF feature may merge this function with other functions with the + // same definition and it may confuse the crash report processing system. + static int static_variable_to_make_this_function_unique = 0; + base::debug::Alias(&static_variable_to_make_this_function_unique); + + volatile int* null_pointer = nullptr; *null_pointer = 0; } |