RFR: 8344104: TestMergeStores fails with ArrayIndexOutOfBoundException [v2]

Christian Hagedorn chagedorn at openjdk.org
Thu Nov 14 07:35:13 UTC 2024


On Thu, 14 Nov 2024 07:05:59 GMT, Emanuel Peter <epeter at openjdk.org> wrote:

>> Test-bug: `RANDOM.nextInt()` would occasionally return a `min_int`. And sadly this overflows: `Math.abs(min_int) == min_int`. Wen we calculate it `% 100`, it still gives us a negative value, and we end up out of bounds. Fixed with a mask.
>
> Emanuel Peter has updated the pull request incrementally with one additional commit since the last revision:
> 
>   do what shipilev said

Hitting the unlikely but at least it produced a 42 instead, though a negative one :-)

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

Marked as reviewed by chagedorn (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/22080#pullrequestreview-2435247224


More information about the hotspot-compiler-dev mailing list