Bug 1119030: Make MOZ_CRASHes unique to prevent compiler folding. r=Waldo
authorDavid Major <dmajor@mozilla.com>
Thu, 08 Jan 2015 19:13:04 +1300
changeset 248424 a17fa338bf0fabf225df39e70a6acae45f74bdb4
parent 248423 2ba42b1966bc18e2911ef1552acf859dfecf8579
child 248425 b936ab379c755646f876d3120c3e105c4e8128eb
push id4489
push userraliiev@mozilla.com
push dateMon, 23 Feb 2015 15:17:55 +0000
treeherdermozilla-beta@fd7c3dc24146 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersWaldo
bugs1119030
milestone37.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1119030: Make MOZ_CRASHes unique to prevent compiler folding. r=Waldo
mfbt/Assertions.h
--- a/mfbt/Assertions.h
+++ b/mfbt/Assertions.h
@@ -193,40 +193,40 @@ MOZ_ReportCrash(const char* aStr, const 
     */
 
 __declspec(noreturn) __inline void MOZ_NoReturn() {}
 
 #  ifdef __cplusplus
 #    define MOZ_REALLY_CRASH() \
        do { \
          ::__debugbreak(); \
-         *((volatile int*) NULL) = 123; \
+         *((volatile int*) NULL) = __LINE__; \
          ::TerminateProcess(::GetCurrentProcess(), 3); \
          ::MOZ_NoReturn(); \
        } while (0)
 #  else
 #    define MOZ_REALLY_CRASH() \
        do { \
          __debugbreak(); \
-         *((volatile int*) NULL) = 123; \
+         *((volatile int*) NULL) = __LINE__; \
          TerminateProcess(GetCurrentProcess(), 3); \
          MOZ_NoReturn(); \
        } while (0)
 #  endif
 #else
 #  ifdef __cplusplus
 #    define MOZ_REALLY_CRASH() \
        do { \
-         *((volatile int*) NULL) = 123; \
+         *((volatile int*) NULL) = __LINE__; \
          ::abort(); \
        } while (0)
 #  else
 #    define MOZ_REALLY_CRASH() \
        do { \
-         *((volatile int*) NULL) = 123; \
+         *((volatile int*) NULL) = __LINE__; \
          abort(); \
        } while (0)
 #  endif
 #endif
 
 /*
  * MOZ_CRASH([explanation-string]) crashes the program, plain and simple, in a
  * Breakpad-compatible way, in both debug and release builds.