DescriptionRewriting patch logic without the comma operator.
When running /analyze on all of Chrome there were three warnings about
using the comma operator in a tested expression. One was a genuine bug
and the other two were in UncompressAndPatchChromeArchive. Rewriting
to use nested if statements resolves these warnings (getting the count
to zero) and makes the code clearer.
Resolving the warning is not crucial, but it makes it easier to make a
zero-tolerance policy for that warning and thus avoid future bugs.
Plus, it makes the setup code easier to read.
The warnings are:
src\chrome\installer\setup\setup_main.cc(174) : warning C6319: Use of the comma-operator in a tested expression causes the left argument to be ignored when it has no side-effects.
src\chrome\installer\setup\setup_main.cc(176) : warning C6319: Use of the comma-operator in a tested expression causes the left argument to be ignored when it has no side-effects.
The bug that was found through this warning, which could eventually
have been very serious, was fixed here:
https://codereview.chromium.org/678193003
BUG=427616
Committed: https://crrev.com/944c28c5ee375cd1eec61e4530750e37c29f65be
Cr-Commit-Position: refs/heads/master@{#314389}
Patch Set 1 #
Total comments: 2
Patch Set 2 : Fixing indentation as per code-review. #Messages
Total messages: 9 (2 generated)
|