Skip to content

Commit 7181679

Browse files
pkastingChromium LUCI CQ
authored and
Chromium LUCI CQ
committed
Fix -Wunreachable-code-aggressive: sandbox/
Bug: 1066980 Change-Id: Ia1c48a2adb15e8bb27fc817a15a49cf1083095b1 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/2993567 Auto-Submit: Peter Kasting <pkasting@chromium.org> Commit-Queue: Will Harris <wfh@chromium.org> Reviewed-by: Will Harris <wfh@chromium.org> Cr-Commit-Position: refs/heads/master@{#897877}
1 parent d3eaad4 commit 7181679

File tree

2 files changed

+5
-9
lines changed

2 files changed

+5
-9
lines changed

sandbox/win/src/file_policy_test.cc

+4-7
Original file line numberDiff line numberDiff line change
@@ -89,14 +89,11 @@ SBOX_TESTS_COMMAND int File_Win32Create(int argc, wchar_t** argv) {
8989
if (INVALID_HANDLE_VALUE != file) {
9090
::CloseHandle(file);
9191
return SBOX_TEST_SUCCEEDED;
92-
} else {
93-
if (ERROR_ACCESS_DENIED == ::GetLastError()) {
94-
return SBOX_TEST_DENIED;
95-
} else {
96-
return SBOX_TEST_FAILED;
97-
}
9892
}
99-
return SBOX_TEST_SUCCEEDED;
93+
if (ERROR_ACCESS_DENIED == ::GetLastError()) {
94+
return SBOX_TEST_DENIED;
95+
}
96+
return SBOX_TEST_FAILED;
10097
}
10198

10299
// Creates the file in parameter using the NtCreateFile api and returns if the

sandbox/win/tests/common/controller.cc

+1-2
Original file line numberDiff line numberDiff line change
@@ -178,8 +178,7 @@ bool TestRunner::AddFsRule(TargetPolicy::Semantics semantics,
178178
}
179179

180180
int TestRunner::RunTest(const wchar_t* command) {
181-
if (MAX_STATE > 10)
182-
return SBOX_TEST_INVALID_PARAMETER;
181+
DCHECK_LE(MAX_STATE, 10);
183182

184183
wchar_t state_number[2];
185184
state_number[0] = static_cast<wchar_t>(L'0' + state_);

0 commit comments

Comments
 (0)