fix bug in utf8_length_from_utf16() on big endian#884
Merged
Conversation
0db0afc to
1638f45
Compare
this is strictly not a violation of the api, since it only happens on invalid input where the result is implementation defined.
1638f45 to
7a19b1d
Compare
Member
|
Thanks for catching this. |
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.
there was a bug introduced in version 7.7.0 https://github.com/simdutf/simdutf/pull/863/files#diff-d1273109039f1fb5e518645f4a1560e70c431b5dab1f8ace04ed6852f1dc3f6aR2161-R2169
the bug only matters when all of these conditions are met:
utf8_length_from_utf16be_with_replacement()would give another answer thanutf8_length_from_utf16be()(requires invalid input)the api guarantee for utf8_length_from_utf16be() is: (quoting from the documentation)
this is strictly speaking not wrong.
the test added in this PR fails when running on s390x (big endian), but succeeds with the bug fix applied.