grain
grain copied to clipboard
String.byteLength incorrect for strings larger than 2GB
String.byteLength naively returns the byte length as a Grain simple number, which is capped at 2^31.
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.