mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-11 10:08:41 +00:00
Bug 1412048 - Replace NS_RUNTIMEABORT(var) with MOZ_CRASH_UNSAFE_OOL(var). r=froydnj data-review=francois
And remove unreachable code after MOZ_CRASH_UNSAFE_OOL(). MOZ_CRASH_UNSAFE_OOL causes data collection because crash strings are annotated to crash-stats and are publicly visible. Firefox data stewards must do data review on usages of this macro. However, all the crash strings this patch collects with MOZ_CRASH_UNSAFE_OOL are already collected with NS_RUNTIMEABORT. MozReview-Commit-ID: IHmJfuxXSqw --HG-- extra : rebase_source : 031f30934b58a7b87f960e57179641d44aefe5c5 extra : source : fe9f638a56a53c8721eecc4273dcc074c988546e
This commit is contained in:
parent
1df202b177
commit
73037a0f6a
@ -189,7 +189,7 @@ GLBlitTextureImageHelper::SetBlitFramebufferForDestTexture(GLuint aTexture)
|
||||
// your texture is not texture complete -- that is, you
|
||||
// allocated a texture name, but didn't actually define its
|
||||
// size via a call to TexImage2D.
|
||||
NS_RUNTIMEABORT(msg.get());
|
||||
MOZ_CRASH_UNSAFE_OOL(msg.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -2095,7 +2095,7 @@ gfxFontGroup::GetDefaultFont()
|
||||
mFamilyList.ToString(familiesString);
|
||||
SprintfLiteral(msg, "unable to find a usable font (%.220s)",
|
||||
NS_ConvertUTF16toUTF8(familiesString).get());
|
||||
NS_RUNTIMEABORT(msg);
|
||||
MOZ_CRASH_UNSAFE_OOL(msg);
|
||||
}
|
||||
|
||||
return mDefaultFont.get();
|
||||
|
@ -2784,7 +2784,7 @@ MessageChannel::DebugAbort(const char* file, int line, const char* cond,
|
||||
pending.popFirst();
|
||||
}
|
||||
|
||||
NS_RUNTIMEABORT(why);
|
||||
MOZ_CRASH_UNSAFE_OOL(why);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -303,14 +303,14 @@ FatalError(const char* aProtocolName, const char* aMsg, bool aIsParent)
|
||||
MOZ_CRASH("IPC FatalError in the parent process!");
|
||||
} else {
|
||||
formattedMessage.AppendLiteral("\". abort()ing as a result.");
|
||||
NS_RUNTIMEABORT(formattedMessage.get());
|
||||
MOZ_CRASH_UNSAFE_OOL(formattedMessage.get());
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
LogicError(const char* aMsg)
|
||||
{
|
||||
NS_RUNTIMEABORT(aMsg);
|
||||
MOZ_CRASH_UNSAFE_OOL(aMsg);
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -773,7 +773,8 @@ ErrorLoadingSheet(nsIURI* aURI, const char* aMsg, FailureAction aFailureAction)
|
||||
#ifdef MOZ_CRASHREPORTER
|
||||
AnnotateCrashReport(aURI);
|
||||
#endif
|
||||
NS_RUNTIMEABORT(errorMessage.get());
|
||||
|
||||
MOZ_CRASH_UNSAFE_OOL(errorMessage.get());
|
||||
}
|
||||
|
||||
void
|
||||
|
@ -37,7 +37,7 @@ class TabChild;
|
||||
if (abort) { \
|
||||
msg.AppendLiteral(" (set NECKO_ERRORS_ARE_FATAL=0 in your environment " \
|
||||
"to convert this error into a warning.)"); \
|
||||
NS_RUNTIMEABORT(msg.get()); \
|
||||
MOZ_CRASH_UNSAFE_OOL(msg.get()); \
|
||||
} else { \
|
||||
msg.AppendLiteral(" (set NECKO_ERRORS_ARE_FATAL=1 in your environment " \
|
||||
"to convert this warning into a fatal error.)"); \
|
||||
|
@ -40,42 +40,42 @@ GdkErrorHandler(const gchar *log_domain, GLogLevelFlags log_level,
|
||||
NS_NAMED_LITERAL_CSTRING(serialString, "(Details: serial ");
|
||||
int32_t start = buffer.Find(serialString);
|
||||
if (start == kNotFound)
|
||||
NS_RUNTIMEABORT(message);
|
||||
MOZ_CRASH_UNSAFE_OOL(message);
|
||||
|
||||
start += serialString.Length();
|
||||
errno = 0;
|
||||
event.serial = strtol(buffer.BeginReading() + start, &endptr, 10);
|
||||
if (errno)
|
||||
NS_RUNTIMEABORT(message);
|
||||
MOZ_CRASH_UNSAFE_OOL(message);
|
||||
|
||||
NS_NAMED_LITERAL_CSTRING(errorCodeString, " error_code ");
|
||||
if (!StringBeginsWith(Substring(endptr, buffer.EndReading()), errorCodeString))
|
||||
NS_RUNTIMEABORT(message);
|
||||
MOZ_CRASH_UNSAFE_OOL(message);
|
||||
|
||||
errno = 0;
|
||||
event.error_code = strtol(endptr + errorCodeString.Length(), &endptr, 10);
|
||||
if (errno)
|
||||
NS_RUNTIMEABORT(message);
|
||||
MOZ_CRASH_UNSAFE_OOL(message);
|
||||
|
||||
NS_NAMED_LITERAL_CSTRING(requestCodeString, " request_code ");
|
||||
if (!StringBeginsWith(Substring(endptr, buffer.EndReading()), requestCodeString))
|
||||
NS_RUNTIMEABORT(message);
|
||||
MOZ_CRASH_UNSAFE_OOL(message);
|
||||
|
||||
errno = 0;
|
||||
event.request_code = strtol(endptr + requestCodeString.Length(), &endptr, 10);
|
||||
if (errno)
|
||||
NS_RUNTIMEABORT(message);
|
||||
MOZ_CRASH_UNSAFE_OOL(message);
|
||||
|
||||
NS_NAMED_LITERAL_CSTRING(minorCodeString, " minor_code ");
|
||||
start = buffer.Find(minorCodeString, /* aIgnoreCase = */ false,
|
||||
endptr - buffer.BeginReading());
|
||||
if (!start)
|
||||
NS_RUNTIMEABORT(message);
|
||||
MOZ_CRASH_UNSAFE_OOL(message);
|
||||
|
||||
errno = 0;
|
||||
event.minor_code = strtol(buffer.BeginReading() + start + minorCodeString.Length(), nullptr, 10);
|
||||
if (errno)
|
||||
NS_RUNTIMEABORT(message);
|
||||
MOZ_CRASH_UNSAFE_OOL(message);
|
||||
|
||||
event.display = GDK_DISPLAY_XDISPLAY(gdk_display_get_default());
|
||||
// Gdk does not provide resource ID
|
||||
@ -84,7 +84,7 @@ GdkErrorHandler(const gchar *log_domain, GLogLevelFlags log_level,
|
||||
X11Error(event.display, &event);
|
||||
} else {
|
||||
g_log_default_handler(log_domain, log_level, message, user_data);
|
||||
NS_RUNTIMEABORT(message);
|
||||
MOZ_CRASH_UNSAFE_OOL(message);
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -144,8 +144,7 @@ X11Error(Display *display, XErrorEvent *event) {
|
||||
#endif
|
||||
#endif
|
||||
|
||||
NS_RUNTIMEABORT(notes.get());
|
||||
return 0; // not reached
|
||||
MOZ_CRASH_UNSAFE_OOL(notes.get());
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -166,7 +166,7 @@ AssertActivityIsLegal()
|
||||
{
|
||||
if (gActivityTLS == BAD_TLS_INDEX || PR_GetThreadPrivate(gActivityTLS)) {
|
||||
if (PR_GetEnv("MOZ_FATAL_STATIC_XPCOM_CTORS_DTORS")) {
|
||||
NS_RUNTIMEABORT(kStaticCtorDtorWarning);
|
||||
MOZ_CRASH_UNSAFE_OOL(kStaticCtorDtorWarning);
|
||||
} else {
|
||||
NS_WARNING(kStaticCtorDtorWarning);
|
||||
}
|
||||
|
@ -671,7 +671,7 @@ NS_InitXPCOM2(nsIServiceManager** aResult,
|
||||
// Initialize the JS engine.
|
||||
const char* jsInitFailureReason = JS_InitWithFailureDiagnostic();
|
||||
if (jsInitFailureReason) {
|
||||
NS_RUNTIMEABORT(jsInitFailureReason);
|
||||
MOZ_CRASH_UNSAFE_OOL(jsInitFailureReason);
|
||||
}
|
||||
sInitializedJS = true;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user