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

Unified Diff: base/logging.h

Issue 2676483002: Make CHECK int 3 on Windows, rather than crash (Closed)
Patch Set: . 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 | « no previous file | base/logging_unittest.cc » ('j') | base/logging_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: base/logging.h
diff --git a/base/logging.h b/base/logging.h
index 5174e6d375540cd0f0bf355034c17812a66bf37b..e8c0d377ee2f377fdf9c155b369ebf2813bccd48 100644
--- a/base/logging.h
+++ b/base/logging.h
@@ -461,10 +461,10 @@ class CheckOpResult {
};
// Crashes in the fastest, simplest possible way with no attempt at logging.
-#if defined(COMPILER_GCC) || defined(__clang__)
+#if defined(COMPILER_GCC) || (defined(__clang__) && !defined(OS_WIN))
#define IMMEDIATE_CRASH() __builtin_trap()
-#else
-#define IMMEDIATE_CRASH() ((void)(*(volatile char*)0 = 0))
+#elif defined(COMPILER_MSVC) || (defined(__clang__) && defined(OS_WIN))
+#define IMMEDIATE_CRASH() __debugbreak()
Will Harris 2017/02/02 03:12:03 might be nice to have an #else and an #error here
Primiano Tucci (use gerrit) 2017/02/03 03:15:05 not an owner, but +1 to the #error pointing to crb
scottmg 2017/02/06 19:50:47 That's why I left the deref null in the #else bloc
#endif
// CHECK dies with a fatal error if condition is not true. It is *not*
« no previous file with comments | « no previous file | base/logging_unittest.cc » ('j') | base/logging_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698