| Index: base/logging.h
|
| diff --git a/base/logging.h b/base/logging.h
|
| index 8e448aba898bfd38274a54a993c89abb23fc05f6..e1982eb6a84f27cd1e898dfff0764f5a2cd880fc 100644
|
| --- a/base/logging.h
|
| +++ b/base/logging.h
|
| @@ -556,14 +556,16 @@ class CheckOpResult {
|
| // instruction following the __debugbreak() to have it emit distinct locations
|
| // for CHECKs rather than collapsing them all together. It would be nice to use
|
| // a short intrinsic to do this (and perhaps have only one implementation for
|
| -// both clang and MSVC), however clang-cl currently does not support intrinsics
|
| -// here. Adding the nullptr store to the MSVC path adds unnecessary bloat.
|
| +// both clang and MSVC), however clang-cl currently does not support intrinsics.
|
| +// On the flip side, MSVC x64 doesn't support inline asm. So, we have to have
|
| +// two implementations. Normally clang-cl's version will be 5 bytes (1 for
|
| +// `int3`, 2 for `ud2`, 2 for `push byte imm`, however, TODO(scottmg):
|
| +// https://crbug.com/694670 clang-cl doesn't currently support %'ing
|
| +// __COUNTER__, so eventually it will emit the dword form of push.
|
| // TODO(scottmg): Reinvestigate a short sequence that will work on both
|
| // compilers once clang supports more intrinsics. See https://crbug.com/693713.
|
| #if defined(__clang__)
|
| -#define IMMEDIATE_CRASH() \
|
| - (__debugbreak(), (void)(*reinterpret_cast<volatile unsigned char*>(0) = \
|
| - static_cast<unsigned char>(__COUNTER__)))
|
| +#define IMMEDIATE_CRASH() ({__asm int 3 __asm ud2 __asm push __COUNTER__})
|
| #else
|
| #define IMMEDIATE_CRASH() __debugbreak()
|
| #endif // __clang__
|
|
|