RFR: 8325002: Exceptions::fthrow needs to ensure it truncates to a valid utf8 string
David Holmes
dholmes at openjdk.org
Fri Jul 26 21:46:42 UTC 2024
On Fri, 26 Jul 2024 21:42:32 GMT, David Holmes <dholmes at openjdk.org> wrote:
>> src/hotspot/share/utilities/utf8.cpp line 440:
>>
>>> 438: // Could be first or fourth byte. If fourth
>>> 439: // then 2 bytes before will have second byte pattern (0b1010xxxx)
>>> 440: if ((index - 3) >= 0 && ((buffer[index - 2] & 0xA0) == 0xA0)) {
>>
>> Suggestion:
>>
>> if ((index - 3) >= 0 && ((buffer[index - 2] & 0xF0) == 0xA0)) {
>
> I don't understand the rationale for the suggestion sorry.
I am looking specifically for the second byte of six pattern.
-------------
PR Review Comment: https://git.openjdk.org/jdk/pull/20345#discussion_r1693630123
More information about the hotspot-dev
mailing list