Closed Bug 1735464 Opened 3 years ago Closed 3 years ago

PrevWordBreakClassWalker::IsStartOfGroup: Don't advance mOffset if PrevChar fails

Categories

(Core :: Disability Access APIs, defect)

defect

Tracking

()

RESOLVED FIXED
95 Branch
Tracking Status
firefox95 --- fixed

People

(Reporter: Jamie, Assigned: Jamie)

References

Details

Attachments

(1 file)

IsStartOfGroup wants to peek at the previous character. It calls PrevChar, but it doesn't check for failure. It then unconditionally increments mOffset to "undo" PrevChar. If PrevChar failed, that means we're now 1 character after where we started. This wasn't causing any test failures and I can't think of a test case that shows breakage here. Nevertheless, it definitely doesn't make sense and could cause difficult-to-diagnose bugs.

IsStartOfGroup wants to peek at the previous character.
It calls PrevChar, but it doesn't check for failure.
It then unconditionally increments mOffset to "undo" PrevChar.
If PrevChar failed, that means we're now 1 character after where we started.
This wasn't causing any test failures and I can't think of a test case that shows breakage here.
Nevertheless, it definitely doesn't make sense and could cause difficult-to-diagnose bugs.

Attachment #9245662 - Attachment description: Bug 1729407: PrevWordBreakClassWalker::IsStartOfGroup: Don't advance mOffset if PrevChar fails. → Bug 1735464: PrevWordBreakClassWalker::IsStartOfGroup: Don't advance mOffset if PrevChar fails.
Pushed by jteh@mozilla.com: https://hg.mozilla.org/integration/autoland/rev/2adf5103cb9f PrevWordBreakClassWalker::IsStartOfGroup: Don't advance mOffset if PrevChar fails. r=eeejay
Status: NEW → RESOLVED
Closed: 3 years ago
Resolution: --- → FIXED
Target Milestone: --- → 95 Branch
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: