PrevWordBreakClassWalker::IsStartOfGroup: Don't advance mOffset if PrevChar fails
Categories
(Core :: Disability Access APIs, defect)
Tracking
()
Tracking | Status | |
---|---|---|
firefox95 | --- | fixed |
People
(Reporter: Jamie, Assigned: Jamie)
References
Details
Attachments
(1 file)
(deleted),
text/x-phabricator-request
|
Details |
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.
Assignee | ||
Comment 1•3 years ago
|
||
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.
Updated•3 years ago
|
Comment 3•3 years ago
|
||
bugherder |
Description
•