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

String.byteLength incorrect for strings larger than 2GB #1064

Open
ospencer opened this issue Dec 10, 2021 · 1 comment
Open

String.byteLength incorrect for strings larger than 2GB #1064

ospencer opened this issue Dec 10, 2021 · 1 comment
Labels

Comments

@ospencer
Copy link
Member

String.byteLength naively returns the byte length as a Grain simple number, which is capped at 2^31.

@cician
Copy link
Contributor

cician commented Feb 6, 2022

Just a little clarification. I wrote in the description of PR #1126 that it fixes this issue, but it's not exact. There I actually only fixed it for String in the range between 1 and 2 GiB (exclusive). For 2GiB and up we run into issues because of confusion with signed vs unsigned WasmI32 with a lot of fun issues like strings of negative length. Consider me guilty.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants