Commit 4e7e6b35 authored by brucedawson's avatar brucedawson Committed by Commit bot

Fix unreachable code bug caused by anding with zero, per finnur@.

VC++'s /analyze pointed out that an incorrect operator was being used.
The warning was:

src\chrome\browser\enumerate_modules_model_win.cc(898) : warning C6313:
Incorrect operator:  zero-valued flag cannot be tested with bitwise-and.
Use an equality test to check for zero-valued flags.

This bug dates back to the original code in November 2010. Fixed to 'and' with the INVESTIGATING value, as intended, after discussion with finnur@.

BUG=427616

Review URL: https://codereview.chromium.org/700713002

Cr-Commit-Position: refs/heads/master@{#302715}
parent c84b223b
......@@ -895,27 +895,28 @@ base::ListValue* EnumerateModulesModel::GetModuleList() const {
IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_SEPARATOR) +
base::ASCIIToWide(" ");
if (module->recommended_action & ModuleEnumerator::NONE) {
if (module->recommended_action & ModuleEnumerator::INVESTIGATING) {
actions = l10n_util::GetStringUTF16(
IDS_CONFLICTS_CHECK_INVESTIGATING);
}
if (module->recommended_action & ModuleEnumerator::UNINSTALL) {
if (!actions.empty())
actions += separator;
actions = l10n_util::GetStringUTF16(
IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_UNINSTALL);
}
if (module->recommended_action & ModuleEnumerator::UPDATE) {
if (!actions.empty())
actions += separator;
actions += l10n_util::GetStringUTF16(
IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_UPDATE);
}
if (module->recommended_action & ModuleEnumerator::DISABLE) {
if (!actions.empty())
actions += separator;
actions += l10n_util::GetStringUTF16(
IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_DISABLE);
} else {
if (module->recommended_action & ModuleEnumerator::UNINSTALL) {
if (!actions.empty())
actions += separator;
actions = l10n_util::GetStringUTF16(
IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_UNINSTALL);
}
if (module->recommended_action & ModuleEnumerator::UPDATE) {
if (!actions.empty())
actions += separator;
actions += l10n_util::GetStringUTF16(
IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_UPDATE);
}
if (module->recommended_action & ModuleEnumerator::DISABLE) {
if (!actions.empty())
actions += separator;
actions += l10n_util::GetStringUTF16(
IDS_CONFLICTS_CHECK_POSSIBLE_ACTION_DISABLE);
}
}
base::string16 possible_resolution =
actions.empty() ? base::ASCIIToWide("")
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment