Skip to content

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
bnoordhuis added a commit to bnoordhuis/mini_racer that referenced this pull request Mar 13, 2025
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.
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