Bug 1338574 - Assertions.cpp can't use MOZ_CRASH_ANNOTATE, so set the crash reason directly. r=froydnj
authorEmanuel Hoogeveen <emanuel.hoogeveen@gmail.com>
Wed, 22 Feb 2017 15:42:00 -0500
changeset 373466 294c257938dcf6c401bbe2ba5f282a51941399ce
parent 373465 bb33fb4a86b68fa535cfb8285e504b30e596eafd
child 373467 746252fb0cbc609d629f9f91c4b32db9810e2011
push id10863
push userjlorenzo@mozilla.com
push dateMon, 06 Mar 2017 23:02:23 +0000
treeherdermozilla-aurora@0931190cd725 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersfroydnj
bugs1338574
milestone54.0a1
Bug 1338574 - Assertions.cpp can't use MOZ_CRASH_ANNOTATE, so set the crash reason directly. r=froydnj
mfbt/Assertions.cpp
--- a/mfbt/Assertions.cpp
+++ b/mfbt/Assertions.cpp
@@ -24,17 +24,17 @@ MOZ_CrashOOL(int aLine, const char* aRea
 #else
 MFBT_API MOZ_COLD MOZ_NORETURN MOZ_NEVER_INLINE void
 MOZ_CrashOOL(const char* aFilename, int aLine, const char* aReason)
 #endif
 {
 #ifdef DEBUG
   MOZ_ReportCrash(aReason, aFilename, aLine);
 #endif
-  MOZ_CRASH_ANNOTATE(aReason);
+  gMozCrashReason = aReason;
   MOZ_REALLY_CRASH(aLine);
 }
 
 static char sPrintfCrashReason[sPrintfCrashReasonSize] = {};
 static mozilla::Atomic<bool> sCrashing(false);
 
 #ifndef DEBUG
 MFBT_API MOZ_COLD MOZ_NORETURN MOZ_NEVER_INLINE MOZ_FORMAT_PRINTF(2, 3) void
@@ -54,13 +54,13 @@ MOZ_CrashPrintf(const char* aFilename, i
   int ret = vsnprintf(sPrintfCrashReason, sPrintfCrashReasonSize,
                       aFormat, aArgs);
   va_end(aArgs);
   MOZ_RELEASE_ASSERT(ret >= 0 && size_t(ret) < sPrintfCrashReasonSize,
     "Could not write the explanation string to the supplied buffer!");
 #ifdef DEBUG
   MOZ_ReportCrash(sPrintfCrashReason, aFilename, aLine);
 #endif
-  MOZ_CRASH_ANNOTATE(sPrintfCrashReason);
+  gMozCrashReason = sPrintfCrashReason;
   MOZ_REALLY_CRASH(aLine);
 }
 
 MOZ_END_EXTERN_C