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

Martin Doerr mdoerr at openjdk.org
Thu Aug 15 09:09:49 UTC 2024


On Thu, 15 Aug 2024 07:59:20 GMT, Andrew Haley <aph at openjdk.org> wrote:

>> Port for s390x and PPC for the bug: [JDK-8337958](https://bugs.openjdk.org/browse/JDK-8337958), Out-of-bounds array access in secondary_super_cache
>
> 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.)

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

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


More information about the hotspot-dev mailing list