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

Unified Diff: pdf/pdf.cc

Issue 802503003: Call _set_FMA3_enable(0); to work around VS 2013 CRT AVX bug. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Comment fix. Created 6 years 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: pdf/pdf.cc
diff --git a/pdf/pdf.cc b/pdf/pdf.cc
index 6a4507f4fc35e40bb50ce1c430ecef84006da8fa..f15c8892278a6e4bf9b134ae322e0ad73bd4ddfa 100644
--- a/pdf/pdf.cc
+++ b/pdf/pdf.cc
@@ -56,6 +56,17 @@ BOOL APIENTRY DllMain(HMODULE module, DWORD reason_for_call, LPVOID reserved) {
// and crash in a way interceptable by breakpad of parent module.
_set_invalid_parameter_handler(HandleInvalidParameter);
_set_purecall_handler(HandlePureVirtualCall);
+
+#if defined(ARCH_CPU_X86_64) && _MSC_VER <= 1800
+ // VS2013's CRT only checks the existence of FMA3 instructions, not the
+ // enabled-ness of them at the OS level (this is fixed in VS2015). We force
+ // off usage of FMA3 instructions in the CRT to avoid using that path and
+ // hitting illegal instructions when running on CPUs that support FMA3, but
+ // OSs that don't. Because we use the static library CRT we have to call
+ // this function once in each DLL.
+ // See http://crbug.com/436603.
+ _set_FMA3_enable(0);
+#endif // ARCH_CPU_X86_64 && _MSC_VER <= 1800
}
return TRUE;
}
« 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