mirror of
https://github.com/yuzu-emu/breakpad.git
synced 2025-09-16 06:07:10 +00:00
Make breakpad build with -Wimplicit-fallthrough (on linux)
Fixes a bug where MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST would unintentionally get two reason strings appended. Bug: 177475 Change-Id: I4957268328a242c7c75bbff8add98e9a48ba83ad Reviewed-on: https://chromium-review.googlesource.com/895705 Reviewed-by: Mike Frysinger <vapier@chromium.org> Reviewed-by: Mark Mentovai <mark@chromium.org>
This commit is contained in:
parent
6d001e7159
commit
fd99ff473c
|
@ -61,6 +61,22 @@
|
||||||
#include "processor/basic_code_modules.h"
|
#include "processor/basic_code_modules.h"
|
||||||
#include "processor/logging.h"
|
#include "processor/logging.h"
|
||||||
|
|
||||||
|
// All intentional fallthroughs in breakpad are in this file, so define
|
||||||
|
// this macro locally.
|
||||||
|
// If you ever move this to a .h file, make sure it's defined in a
|
||||||
|
// private header file: clang suggests the first macro expanding to
|
||||||
|
// [[clang::fallthrough]] in its diagnostics, so if BP_FALLTHROUGH
|
||||||
|
// is visible in code depending on breakpad, clang would suggest
|
||||||
|
// BP_FALLTHROUGH for code depending on breakpad, instead of the
|
||||||
|
// client code's own fallthrough macro.
|
||||||
|
// TODO(thakis): Once everyone uses C++17, use its [[fallthrough]] instead.
|
||||||
|
#if defined(__clang__)
|
||||||
|
#define BP_FALLTHROUGH [[clang::fallthrough]]
|
||||||
|
#else
|
||||||
|
#define BP_FALLTHROUGH
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
namespace google_breakpad {
|
namespace google_breakpad {
|
||||||
|
|
||||||
|
|
||||||
|
@ -1969,6 +1985,7 @@ string MinidumpModule::code_identifier() const {
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
// Otherwise fall through to the case below.
|
// Otherwise fall through to the case below.
|
||||||
|
BP_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
case MD_OS_MAC_OS_X:
|
case MD_OS_MAC_OS_X:
|
||||||
|
@ -5199,7 +5216,7 @@ bool Minidump::Read() {
|
||||||
stream_type << ", but can only deal with one";
|
stream_type << ", but can only deal with one";
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
// Fall through to default
|
BP_FALLTHROUGH;
|
||||||
}
|
}
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
|
|
|
@ -893,6 +893,7 @@ string MinidumpProcessor::GetCrashReason(Minidump *dump, uint64_t *address) {
|
||||||
break;
|
break;
|
||||||
case MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST:
|
case MD_EXCEPTION_CODE_MAC_PPC_ALTIVEC_ASSIST:
|
||||||
reason.append("EXC_PPC_ALTIVECASSIST");
|
reason.append("EXC_PPC_ALTIVECASSIST");
|
||||||
|
break;
|
||||||
default:
|
default:
|
||||||
reason.append(flags_string);
|
reason.append(flags_string);
|
||||||
BPLOG(INFO) << "Unknown exception reason " << reason;
|
BPLOG(INFO) << "Unknown exception reason " << reason;
|
||||||
|
|
Loading…
Reference in a new issue