Bug 1681846 - Ensure MOZ_CRASH() stores the reason in crash reports on 32-bit ARM/Android builds r=glandium

Differential Revision: https://phabricator.services.mozilla.com/D179196
This commit is contained in:
Gabriele Svelto 2023-05-31 06:58:36 +00:00
parent 650ab7e4e6
commit 0a57af7f2a

View File

@ -38,6 +38,9 @@ MOZ_END_EXTERN_C
#if defined(MOZ_HAS_MOZGLUE) || defined(MOZILLA_INTERNAL_API)
static inline void AnnotateMozCrashReason(const char* reason) {
gMozCrashReason = reason;
// See bug 1681846, on 32-bit Android ARM the compiler removes the store to
// gMozCrashReason if this barrier is not present.
asm volatile("" ::: "memory");
}
# define MOZ_CRASH_ANNOTATE(...) AnnotateMozCrashReason(__VA_ARGS__)
#else