Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(499)

Unified Diff: chrome/browser/safe_browsing/incident_reporting/verifier_test/verifier_test_dll.cc

Issue 2228233002: Volatilize the global store in DummyExport to defeat Clang's optimizer and avoid ICF (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 4 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/safe_browsing/incident_reporting/verifier_test/verifier_test_dll.cc
diff --git a/chrome/browser/safe_browsing/incident_reporting/verifier_test/verifier_test_dll.cc b/chrome/browser/safe_browsing/incident_reporting/verifier_test/verifier_test_dll.cc
index 0c6f0756bea782b47e5936b10893227c2ecc7833..092c226908d042a2003047cbb760bd0ebe7da573 100644
--- a/chrome/browser/safe_browsing/incident_reporting/verifier_test/verifier_test_dll.cc
+++ b/chrome/browser/safe_browsing/incident_reporting/verifier_test/verifier_test_dll.cc
@@ -9,12 +9,16 @@
namespace {
void (*g_somestate)(int) = nullptr;
-int g_somevalue = 0;
+volatile int g_somevalue = 0;
} // namespace
extern "C"
void DummyExport(int foo) {
+ // The test will patch the code of this function. Do a volatile store to a
+ // global variable to defeat LLVM's dead store elimination and the linker's
+ // ICF. Otherwise the code patch affects code run during DLL unloading.
+ // http://crbug.com/636157
g_somevalue = foo;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698