summaryrefslogtreecommitdiffstats
path: root/components/user_prefs/user_prefs.cc
diff options
context:
space:
mode:
authorjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-23 17:24:36 +0000
committerjoi@chromium.org <joi@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2013-03-23 17:24:36 +0000
commitd64f2bd35f68e838546c11793c0113a30040d764 (patch)
tree22c2e2ec2ca1b915644b2b6859fde0d9b9e95ef6 /components/user_prefs/user_prefs.cc
parentc1f37c839b040a14358e0515c6538cbf48599786 (diff)
downloadchromium_src-d64f2bd35f68e838546c11793c0113a30040d764.zip
chromium_src-d64f2bd35f68e838546c11793c0113a30040d764.tar.gz
chromium_src-d64f2bd35f68e838546c11793c0113a30040d764.tar.bz2
Avoid the possibility of future conflict with another address-of-static due to COMDAT folding.
BUG=none Review URL: https://codereview.chromium.org/12529029 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@190035 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'components/user_prefs/user_prefs.cc')
-rw-r--r--components/user_prefs/user_prefs.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/components/user_prefs/user_prefs.cc b/components/user_prefs/user_prefs.cc
index 123d557..96866d1 100644
--- a/components/user_prefs/user_prefs.cc
+++ b/components/user_prefs/user_prefs.cc
@@ -14,8 +14,10 @@ namespace components {
namespace {
void* UserDataKey() {
- // We just need a unique constant. Use the address of this static member.
- return reinterpret_cast<void*>(&UserPrefs::Get);
+ // We just need a unique constant. Use the address of a static that
+ // COMDAT folding won't touch in an optimizing linker.
+ static int data_key = 0;
+ return reinterpret_cast<void*>(&data_key);
}
} // namespace