Merged
Conversation
lhecker
commented
Feb 29, 2024
| { | ||
| } | ||
| currentOffset = _charOffsets[--col]; | ||
| } |
Member
Author
There was a problem hiding this comment.
FYI It may be easier to review this code outside of the diff viewer. It's actually only 8 lines of code and a couple comments.
Contributor
There was a problem hiding this comment.
GitHub doesn't even have a side-by-side diff 😆
Member
Author
zadjii-msft
approved these changes
Feb 29, 2024
DHowett
approved these changes
Feb 29, 2024
DHowett
pushed a commit
that referenced
this pull request
Feb 29, 2024
Aside from overall simplifying `CharToColumnMapper` this fixes 2 bugs: * The backward search loop may have iterated 1 column too far, because it didn't stop at `*current <= *target`, but rather at `*(current - 1) <= *target`. This issue was only apparent when surrogate pairs were being used in a row. * When the target offset is that of a trailing surrogate pair the forward search loop may have iterated 1 column too far. It's somewhat unlikely for this to happen since this code is only used through ICU, but you never know. This is a continuation of PR #16775. (cherry picked from commit 043d5cd) Service-Card-Id: 91955569 Service-Version: 1.20
DHowett
pushed a commit
that referenced
this pull request
Feb 29, 2024
Aside from overall simplifying `CharToColumnMapper` this fixes 2 bugs: * The backward search loop may have iterated 1 column too far, because it didn't stop at `*current <= *target`, but rather at `*(current - 1) <= *target`. This issue was only apparent when surrogate pairs were being used in a row. * When the target offset is that of a trailing surrogate pair the forward search loop may have iterated 1 column too far. It's somewhat unlikely for this to happen since this code is only used through ICU, but you never know. This is a continuation of PR #16775. (cherry picked from commit 043d5cd) Service-Card-Id: 91955617 Service-Version: 1.19
DHowett
pushed a commit
that referenced
this pull request
Feb 29, 2024
Aside from overall simplifying `CharToColumnMapper` this fixes 2 bugs: * The backward search loop may have iterated 1 column too far, because it didn't stop at `*current <= *target`, but rather at `*(current - 1) <= *target`. This issue was only apparent when surrogate pairs were being used in a row. * When the target offset is that of a trailing surrogate pair the forward search loop may have iterated 1 column too far. It's somewhat unlikely for this to happen since this code is only used through ICU, but you never know. This is a continuation of PR #16775. (cherry picked from commit 043d5cd) Service-Card-Id: 91955617 Service-Version: 1.19
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.


Aside from overall simplifying
CharToColumnMapperthis fixes 2 bugs:because it didn't stop at
*current <= *target, but rather at*(current - 1) <= *target. This issue was only apparent whensurrogate pairs were being used in a row.
the forward search loop may have iterated 1 column too far.
It's somewhat unlikely for this to happen since this code is
only used through ICU, but you never know.
This is a continuation of PR #16775.