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

Unified Diff: chrome/installer/mini_installer/mini_installer.cc

Issue 2621223003: Fix building ASAN instrumented executables with custom entrypoints (Closed)
Patch Set: nits Created 3 years, 11 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 | « chrome/installer/mini_installer/BUILD.gn ('k') | remoting/host/win/BUILD.gn » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/installer/mini_installer/mini_installer.cc
diff --git a/chrome/installer/mini_installer/mini_installer.cc b/chrome/installer/mini_installer/mini_installer.cc
index 7ca6e9f122a78f44c34582afcd6ec7b7117f8c7b..be29092fd8adaf66086f878babd33898b74a3655 100644
--- a/chrome/installer/mini_installer/mini_installer.cc
+++ b/chrome/installer/mini_installer/mini_installer.cc
@@ -15,7 +15,7 @@
// BufferSecurityCheck="false" compiler: /GS-
// EntryPointSymbol="MainEntryPoint" linker: /ENTRY
// IgnoreAllDefaultLibraries="true" linker: /NODEFAULTLIB
-// OptimizeForWindows98="1" liker: /OPT:NOWIN98
+// OptimizeForWindows98="1" linker: /OPT:NOWIN98
// linker: /SAFESEH:NO
// have the linker merge the sections, saving us ~500 bytes.
@@ -895,6 +895,19 @@ int MainEntryPoint() {
::ExitProcess(result.exit_code);
}
+#if defined(ADDRESS_SANITIZER)
+// Executables instrumented with ASAN need CRT functions. We do not use
+// the /ENTRY switch for ASAN instrumented executable and a "main" function
+// is required.
+int WINAPI WinMain(HINSTANCE hInstance,
+ HINSTANCE hPrevInstance,
+ LPSTR lpCmdLine,
+ int nCmdShow) {
+ MainEntryPoint();
+ return 0;
+}
+#endif
+
// VC Express editions don't come with the memset CRT obj file and linking to
// the obj files between versions becomes a bit problematic. Therefore,
// simply implement memset.
« no previous file with comments | « chrome/installer/mini_installer/BUILD.gn ('k') | remoting/host/win/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698