From 4722484bf69875fcf1132023f997cba9fc7bed16 Mon Sep 17 00:00:00 2001 From: Lei Zhang Date: Thu, 2 Sep 2021 22:11:00 -0700 Subject: [PATCH] Fix compiler errors found with -Wunreachable-code-aggressive. Break statements immediately following returns are unreachable. Bug: chromium:1246232 Change-Id: I0892a66617f7b27b5e317a7d9741f5fcd19249f2 Reviewed-on: https://chromium-review.googlesource.com/c/breakpad/breakpad/+/3140192 Reviewed-by: Robert Sesek --- src/processor/exploitability_linux.cc | 4 ---- src/processor/exploitability_win.cc | 1 - src/processor/minidump.cc | 1 - 3 files changed, 6 deletions(-) diff --git a/src/processor/exploitability_linux.cc b/src/processor/exploitability_linux.cc index 798056df..3ec39dd0 100644 --- a/src/processor/exploitability_linux.cc +++ b/src/processor/exploitability_linux.cc @@ -212,7 +212,6 @@ bool ExploitabilityLinux::EndedOnIllegalWrite(uint64_t instruction_ptr) { // Unsupported architecture. Note that ARM architectures are not // supported because objdump does not support ARM. return false; - break; } // Get memory region around instruction pointer and the number of bytes @@ -382,7 +381,6 @@ bool ExploitabilityLinux::CalculateAddress(const string& address_expression, // This should not occur since the same switch condition // should have terminated this method. return false; - break; } // Add or subtract constant from write address (if applicable). @@ -616,10 +614,8 @@ bool ExploitabilityLinux::BenignCrashTrigger( case MD_EXCEPTION_CODE_LIN_SIGSYS: case MD_EXCEPTION_CODE_LIN_DUMP_REQUESTED: return true; - break; default: return false; - break; } } diff --git a/src/processor/exploitability_win.cc b/src/processor/exploitability_win.cc index b74a7496..3c1f4895 100644 --- a/src/processor/exploitability_win.cc +++ b/src/processor/exploitability_win.cc @@ -193,7 +193,6 @@ ExploitabilityRating ExploitabilityWin::CheckPlatformExploitability() { default: BPLOG(INFO) << "Unrecognized access violation type."; return EXPLOITABILITY_ERR_PROCESSING; - break; } MinidumpMemoryRegion* instruction_region = 0; if (memory_available) { diff --git a/src/processor/minidump.cc b/src/processor/minidump.cc index 9aef25ec..11a5fc4c 100644 --- a/src/processor/minidump.cc +++ b/src/processor/minidump.cc @@ -1163,7 +1163,6 @@ bool MinidumpContext::Read(uint32_t expected_size) { BPLOG(INFO) << "MinidumpContext unknown context type " << HexString(cpu_type); return false; - break; } } SetContextFlags(context_flags);