diff --git a/mfbt/Assertions.cpp b/mfbt/Assertions.cpp index 0db03f42af66..cecf7985cda2 100644 --- a/mfbt/Assertions.cpp +++ b/mfbt/Assertions.cpp @@ -18,21 +18,6 @@ MOZ_BEGIN_EXTERN_C */ MFBT_DATA const char* gMozCrashReason = nullptr; -#ifndef DEBUG -MFBT_API MOZ_COLD MOZ_NORETURN MOZ_NEVER_INLINE void -MOZ_CrashOOL(int aLine, const char* aReason) -#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 - gMozCrashReason = aReason; - MOZ_REALLY_CRASH(aLine); -} - static char sPrintfCrashReason[sPrintfCrashReasonSize] = {}; // Accesses to this atomic are not included in web replay recordings, so that diff --git a/mfbt/Assertions.h b/mfbt/Assertions.h index 6d7a7bcb2bb9..2855829cb005 100644 --- a/mfbt/Assertions.h +++ b/mfbt/Assertions.h @@ -301,15 +301,16 @@ MOZ_NoReturn(int aLine) * to crash-stats and are publicly visible. Firefox data stewards must do data * review on usages of this macro. */ -#ifndef DEBUG -MFBT_API MOZ_COLD MOZ_NORETURN MOZ_NEVER_INLINE void -MOZ_CrashOOL(int aLine, const char* aReason); -# define MOZ_CRASH_UNSAFE_OOL(reason) MOZ_CrashOOL(__LINE__, reason) -#else -MFBT_API MOZ_COLD MOZ_NORETURN MOZ_NEVER_INLINE void -MOZ_CrashOOL(const char* aFilename, int aLine, const char* aReason); -# define MOZ_CRASH_UNSAFE_OOL(reason) MOZ_CrashOOL(__FILE__, __LINE__, reason) +static inline MOZ_COLD MOZ_NORETURN void +MOZ_CrashOOL(const char* aFilename, int aLine, const char* aReason) +{ +#ifdef DEBUG + MOZ_ReportCrash(aReason, aFilename, aLine); #endif + MOZ_CRASH_ANNOTATE(aReason); + MOZ_REALLY_CRASH(aLine); +} +#define MOZ_CRASH_UNSAFE_OOL(reason) MOZ_CrashOOL(__FILE__, __LINE__, reason) static const size_t sPrintfMaxArgs = 4; static const size_t sPrintfCrashReasonSize = 1024;