0

Enable -Wunreachable-code for win/asan.

Bug: 346399
Cq-Include-Trybots: chromium/try:win-asan
Change-Id: I6821921fb14fa107928c9976fe78a1ddb80b606b
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2124047
Auto-Submit: Nico Weber <thakis@chromium.org>
Commit-Queue: James Forshaw <forshaw@chromium.org>
Reviewed-by: James Forshaw <forshaw@chromium.org>
Cr-Commit-Position: refs/heads/master@{#753972}
This commit is contained in:
Nico Weber
2020-03-27 11:42:08 +00:00
committed by Commit Bot
parent 747212fb1f
commit e44258cbf4
2 changed files with 5 additions and 10 deletions
build/config/compiler
sandbox/win/src

@ -1593,8 +1593,7 @@ config("chromium_code") {
# use_libfuzzer: https://crbug.com/1063180
if (!is_nacl && !use_libfuzzer &&
(target_os == "android" || target_os == "chromeos" ||
target_os == "fuchsia" || target_os == "linux" ||
(target_os == "win" && !is_asan))) {
target_os == "fuchsia" || target_os == "linux" || target_os == "win")) {
cflags += [ "-Wunreachable-code" ]
}

@ -407,10 +407,7 @@ TEST(ProcessMitigationsTest, CheckWin81DynamicCodePolicySuccess) {
return;
// TODO(crbug.com/805414): Windows ASan hotpatching requires dynamic code.
#if defined(ADDRESS_SANITIZER)
return;
#endif
#if !defined(ADDRESS_SANITIZER)
std::wstring test_command = L"CheckPolicy ";
test_command += std::to_wstring(TESTPOLICY_DYNAMICCODE);
@ -439,6 +436,7 @@ TEST(ProcessMitigationsTest, CheckWin81DynamicCodePolicySuccess) {
policy2->SetDelayedProcessMitigations(MITIGATION_DYNAMIC_CODE_DISABLE),
SBOX_ALL_OK);
EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner2.RunTest(test_command.c_str()));
#endif
}
// This test validates that we can meddle with dynamic code if the
@ -483,10 +481,7 @@ TEST(ProcessMitigationsTest, CheckWin10DynamicCodeOptOutPolicySuccess) {
return;
// TODO(crbug.com/805414): Windows ASan hotpatching requires dynamic code.
#if defined(ADDRESS_SANITIZER)
return;
#endif
#if !defined(ADDRESS_SANITIZER)
std::wstring test_command = L"CheckPolicy ";
test_command += std::to_wstring(TESTPOLICY_DYNAMICCODEOPTOUT);
@ -516,6 +511,7 @@ TEST(ProcessMitigationsTest, CheckWin10DynamicCodeOptOutPolicySuccess) {
MITIGATION_DYNAMIC_CODE_DISABLE_WITH_OPT_OUT),
SBOX_ALL_OK);
EXPECT_EQ(SBOX_TEST_SUCCEEDED, runner2.RunTest(test_command.c_str()));
#endif
}
// This test validates that we CAN meddle with dynamic code if the