Chromium Code Reviews| Index: base/logging.h |
| diff --git a/base/logging.h b/base/logging.h |
| index 36c9c6f311d1615b98c7507235e0bb41ec68e4b1..98f49945826c95333f1e865b7ff31861fb8ad4b6 100644 |
| --- a/base/logging.h |
| +++ b/base/logging.h |
| @@ -453,11 +453,14 @@ class CheckOpResult { |
| // Make all CHECK functions discard their log strings to reduce code |
| // bloat, and improve performance, for official release builds. |
| -// TODO(akalin): This would be more valuable if there were some way to |
| -// remove BreakDebugger() from the backtrace, perhaps by turning it |
| -// into a macro (like __debugbreak() on Windows). |
| +#if defined(COMPILER_GCC) || __clang__ |
|
danakj
2016/05/16 23:43:11
Can you leave a comment saying this is explicitly
|
| +#define LOGGING_CRASH() __builtin_trap() |
| +#else |
| +#define LOGGING_CRASH() ((void)(*(volatile char*)0 = 0)) |
| +#endif |
| + |
| #define CHECK(condition) \ |
| - !(condition) ? ::base::debug::BreakDebugger() : EAT_STREAM_PARAMETERS |
| + !(condition) ? LOGGING_CRASH() : EAT_STREAM_PARAMETERS |
| #define PCHECK(condition) CHECK(condition) |