Bug 1736968 - Change MOZ_CRASH() to MOZ_ASSUME_UNREACHABLE_MARKER() for abort()'s ARM noreturn case. r=glandium

This MOZ_CRASH() is redundant after calling noreturn function mozalloc_abort. The MOZ_ASSUME_UNREACHABLE_MARKER() annotation makes ARM's "function declared 'noreturn' should not return" warnings go away.

Differential Revision: https://phabricator.services.mozilla.com/D129115
This commit is contained in:
Chris Peterson 2021-10-29 06:04:09 +00:00
Родитель e6b872fb38
Коммит 50b1318658
2 изменённых файлов: 3 добавлений и 9 удалений

Просмотреть файл

@ -29,11 +29,8 @@ if CONFIG["OS_TARGET"] == "WINNT":
UNIFIED_SOURCES += [
"mozalloc.cpp",
"mozalloc_oom.cpp",
]
SOURCES += [
"mozalloc_abort.cpp",
"mozalloc_oom.cpp",
]
if CONFIG["MOZ_MEMORY"]:
@ -45,9 +42,6 @@ if CONFIG["MOZ_MEMORY"]:
"cxxalloc.cpp",
]
if CONFIG["CPU_ARCH"] == "arm" and CONFIG["CC_TYPE"] == "clang":
SOURCES["mozalloc_abort.cpp"].flags += ["-Wno-infinite-recursion"]
FINAL_LIBRARY = "mozglue"
# The strndup declaration in string.h is in an ifdef __USE_GNU section

Просмотреть файл

@ -89,8 +89,8 @@ extern "C" void abort(void) {
// We won't reach here because mozalloc_abort() is MOZ_NORETURN. But that
// annotation isn't used on ARM (see mozalloc_abort.h for why) so we add a
// redundant MOZ_CRASH() here to avoid a "'noreturn' function does return"
// unreachable marker here to avoid a "'noreturn' function does return"
// warning.
MOZ_CRASH();
MOZ_ASSUME_UNREACHABLE_MARKER();
}
#endif