-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
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
Char reinterpret is (kind of) broken #29181
Comments
I think the problem is weirder, i.e. looks like a wrong optimization somwhere? I cannot reproduce outside of the REPL, so far.
|
It's actually the opposite of a mis-optimization: the optimized version is correct, it's the version that's told not to optimize that gives the wrong answer. @vtjnash said on Slack that he thought it might have to do with a bug in our |
Yup, that's it. Fix incoming. |
This code was assuming that character values only have bit-patterns that decoding a string can produce, but of course `reinterpret` can produce any bit pattern in a `Char` whatsoever. The fix doesn't use that assumption and only uses the cache for actual ASCII characters.
This code was assuming that character values only have bit-patterns that decoding a string can produce, but of course `reinterpret` can produce any bit pattern in a `Char` whatsoever. The fix doesn't use that assumption and only uses the cache for actual ASCII characters.
This code was assuming that character values only have bit-patterns that decoding a string can produce, but of course `reinterpret` can produce any bit pattern in a `Char` whatsoever. The fix doesn't use that assumption and only uses the cache for actual ASCII characters.
…29192) This code was assuming that character values only have bit-patterns that decoding a string can produce, but of course `reinterpret` can produce any bit pattern in a `Char` whatsoever. The fix doesn't use that assumption and only uses the cache for actual ASCII characters. (cherry picked from commit 88f74b7)
…29192) This code was assuming that character values only have bit-patterns that decoding a string can produce, but of course `reinterpret` can produce any bit pattern in a `Char` whatsoever. The fix doesn't use that assumption and only uses the cache for actual ASCII characters. (cherry picked from commit 88f74b7)
…29192) This code was assuming that character values only have bit-patterns that decoding a string can produce, but of course `reinterpret` can produce any bit pattern in a `Char` whatsoever. The fix doesn't use that assumption and only uses the cache for actual ASCII characters. (cherry picked from commit 88f74b7)
…29192) This code was assuming that character values only have bit-patterns that decoding a string can produce, but of course `reinterpret` can produce any bit pattern in a `Char` whatsoever. The fix doesn't use that assumption and only uses the cache for actual ASCII characters. (cherry picked from commit 88f74b7)
The fortunate thing is that it doesn't seem to be broken in a way that affects any
Char
values that can be produced naturally—you can only produce the values for which this is broken through reinterpret ofUInt32
values.The text was updated successfully, but these errors were encountered: