Skip to content

AK: Align UTF-16 string storage#9228

Open
kalenikaliaksandr wants to merge 1 commit intoLadybirdBrowser:masterfrom
kalenikaliaksandr:fix-utf16-string-data-alignment
Open

AK: Align UTF-16 string storage#9228
kalenikaliaksandr wants to merge 1 commit intoLadybirdBrowser:masterfrom
kalenikaliaksandr:fix-utf16-string-data-alignment

Conversation

@kalenikaliaksandr
Copy link
Copy Markdown
Member

Align Utf16StringData's UTF-16 flexible storage before it is handed to simdutf for UTF-8 conversion. The previous layout placed the buffer at a 2-byte-aligned offset, so larger vectorized conversions could leave the first code unit corrupted; the Rust parser then saw U+0000 at the start of otherwise valid non-ASCII source and emitted TokenType::Invalid.

Add a LibJS regression covering a long source with non-ASCII text, matching the maps.google.com inline-script failure mode.

Align Utf16StringData's UTF-16 flexible storage before it is handed to
simdutf for UTF-8 conversion. The previous layout placed the buffer at
a 2-byte-aligned offset, so larger vectorized conversions could leave
the first code unit corrupted; the Rust parser then saw U+0000 at the
start of otherwise valid non-ASCII source and emitted
TokenType::Invalid.

Add a LibJS regression covering a long source with non-ASCII text,
matching the maps.google.com inline-script failure mode.
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.

1 participant