Closed
Bug 1378683
Opened 8 years ago
Closed 8 years ago
Fix incorrectly-written retry loop in nsUnicodeNormalizer
Categories
(Core :: Internationalization, enhancement)
Core
Internationalization
Tracking
()
RESOLVED
FIXED
mozilla56
Tracking | Status | |
---|---|---|
firefox56 | --- | fixed |
People
(Reporter: Sylvestre, Assigned: jfkthame)
References
(Blocks 1 open bug)
Details
(Keywords: coverity, Whiteboard: [CID 1402705])
Attachments
(1 file, 1 obsolete file)
1.98 KB,
patch
|
Sylvestre
:
review+
|
Details | Diff | Splinter Review |
Continue; in https://dxr.mozilla.org/mozilla-central/source/intl/unicharutil/nsUnicodeNormalizer_ICU.cpp?q=nsUnicodeNormalizer_ICU.cpp&redirect_type=direct#44 is misleading as we are already at the end of the loop
Comment hidden (mozreview-request) |
Reporter | ||
Updated•8 years ago
|
Assignee: nobody → sledru
Assignee | ||
Comment 2•8 years ago
|
||
mozreview-review |
Comment on attachment 8883864 [details]
Bug 1378683 - Remove a useless continue; declaration
https://reviewboard.mozilla.org/r/154832/#review159844
No, `continue` is needed here to cause the loop to repeat; otherwise it will terminate. (It's normally a single-iteration "loop", using do...while(false); the exceptional case is when we need to re-do the conversion after enlarging the target buffer, in which case we explicitly use `continue` to repeat the block.)
Attachment #8883864 -
Flags: review-
Reporter | ||
Comment 3•8 years ago
|
||
Looks like coverity disagrees with you:
"continue_in_do_while_false: A continue statement within a do-while loop only continues execution of the loop body if the loop continuation condition is still true. Since the condition will never be true in a "do ... while (false);" loop the continue statement has the same effect as a break statement. Did you intend execution to continue at the top of the loop?"
Assignee | ||
Comment 4•8 years ago
|
||
Huh, interesting... I guess that's a gotcha I hadn't noticed! OK, in that case this code doesn't work as intended (although it was meant to be handling a rare case, so the real-world impact is probably small-to-nonexistent), and we should fix it accordingly.
Assignee | ||
Comment 5•8 years ago
|
||
Something like this should make more sense.
Attachment #8883879 -
Flags: review?(sledru)
Reporter | ||
Comment 6•8 years ago
|
||
Good thing with CS: every day, we can still learn something new ;)
Assignee: sledru → jfkthame
Reporter | ||
Comment 7•8 years ago
|
||
Comment on attachment 8883879 [details] [diff] [review]
Fix incorrectly-written retry loop in nsUnicodeNormalizer
Seems to be better but I am no expert in that code ;)
Attachment #8883879 -
Flags: review?(sledru) → review+
Reporter | ||
Updated•8 years ago
|
Summary: Remove a useless continue; declaration → Fix incorrectly-written retry loop in nsUnicodeNormalizer
Assignee | ||
Comment 8•8 years ago
|
||
https://hg.mozilla.org/integration/mozilla-inbound/rev/23ab5a681338e2b4e516ad1f37a184018dce18e7
Bug 1378683 - Fix incorrectly-written retry loop in nsUnicodeNormalizer. r=sylvestre
Pushed by jkew@mozilla.com:
https://hg.mozilla.org/integration/mozilla-inbound/rev/23ab5a681338
Fix incorrectly-written retry loop in nsUnicodeNormalizer. r=sylvestre
Comment 10•8 years ago
|
||
bugherder |
Status: NEW → RESOLVED
Closed: 8 years ago
status-firefox56:
--- → fixed
Resolution: --- → FIXED
Target Milestone: --- → mozilla56
Reporter | ||
Updated•8 years ago
|
Attachment #8883864 -
Attachment is obsolete: true
Reporter | ||
Updated•7 years ago
|
Blocks: coverity-analysis
You need to log in
before you can comment on or make changes to this bug.
Description
•