Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Handle two-byte string alignment padding #333

Merged
merged 1 commit into from
Jan 11, 2025

Conversation

bnoordhuis
Copy link
Collaborator

For compatibility with old clients of the serializer wire format, V8 inserts a padding byte when a two-byte string is not 16 bits aligned, so skip those.

We don't have to emit padding ourselves, V8 handles unaligned strings just fine.

Messages can have an arbitrary amount of padding at the end. Skip that as well.

No test because hitting the right conditions in V8 is rather difficult and brittle.

For compatibility with old clients of the serializer wire format, V8
inserts a padding byte when a two-byte string is not 16 bits aligned,
so skip those.

We don't have to emit padding ourselves, V8 handles unaligned strings
just fine.

Messages can have an arbitrary amount of padding at the end. Skip that
as well.

No test because hitting the right conditions in V8 is rather difficult
and brittle.
@SamSaffron SamSaffron merged commit 9874a17 into rubyjs:main Jan 11, 2025
18 of 25 checks passed
@bnoordhuis bnoordhuis deleted the string-padding branch January 11, 2025 10:18
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants