RFR: 8338365: [PPC64, s390] Out-of-bounds array access in secondary_super_cache

Andrew Haley aph at openjdk.org
Thu Aug 15 10:27:48 UTC 2024


On Thu, 15 Aug 2024 09:05:13 GMT, Martin Doerr <mdoerr at openjdk.org> wrote:

>> src/hotspot/cpu/s390/macroAssembler_s390.cpp line 3323:
>> 
>>> 3321: 
>>> 3322:   // The bitmap is full to bursting.
>>> 3323:   z_cghi(r_array_length, Klass::SECONDARY_SUPERS_BITMAP_FULL - 2);
>> 
>> Suggestion:
>> 
>>   z_chi(r_array_length, Klass::SECONDARY_SUPERS_BITMAP_FULL - 2);
>> 
>> This probably doesn't matter, but it's a 32-bit length.
>
> Correct, chi would be cleaner. cghi works too, because the length is loaded as 32 bit value. (The length is loaded as unsigned 32 bit with zero extend. Not sure if this is ideal, but negative length should not occur AFAIK.)

That's what I was thinking. To use anything other than `chi` is confusing to the reader. (Well, it was confusing to this reader, anyway.)

-------------

PR Review Comment: https://git.openjdk.org/jdk/pull/20578#discussion_r1718235248


More information about the hotspot-dev mailing list