Fix wrong data length written in UnsafeBlitFormatter#1551
Merged
AArnott merged 9 commits intoMessagePack-CSharp:developfrom Mar 12, 2023
Merged
Fix wrong data length written in UnsafeBlitFormatter#1551AArnott merged 9 commits intoMessagePack-CSharp:developfrom
UnsafeBlitFormatter#1551AArnott merged 9 commits intoMessagePack-CSharp:developfrom
Conversation
This API is added for usage in `UnsafeBlitFormatter`.
Contributor
Author
|
Just added tests. As expected, the tests failed in master branch and passed in this PR. |
AArnott
reviewed
Jan 20, 2023
Collaborator
AArnott
left a comment
There was a problem hiding this comment.
Thanks for the fix. It merits some discussion before merging.
src/MessagePack.UnityClient/Assets/Scripts/MessagePack/MessagePackWriter.cs
Outdated
Show resolved
Hide resolved
src/MessagePack.UnityClient/Assets/Scripts/MessagePack/Unity/Extension/UnsafeBlitFormatter.cs
Outdated
Show resolved
Hide resolved
Contributor
Author
|
By the way, although I highly doubt that it would ever run on a big-endian device, I don't think the byte order reversing code is correct. It seems to be reversing the whole data structure instead of reversing each float value. |
Also move the API from Shipped to Unshipped, because it has not in fact shipped yet.
This was referenced Oct 26, 2025
This was referenced Dec 2, 2025
This was referenced Jan 22, 2026
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.
Closes #1550.
In this PR, I added a public API so that I can get the encoded length of an integer, and then fixed the issue using the first method I mentioned in #1550.
I have yet to look into the test folder and add tests at the time of writing.Just added tests.This is my first PR to this project, so please tell me if I did anything wrong.