RFR: 8344104: TestMergeStores fails with ArrayIndexOutOfBoundException
Aleksey Shipilev
shade at openjdk.org
Wed Nov 13 18:07:24 UTC 2024
On Wed, 13 Nov 2024 15:34:07 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.
`Math.abs(Integer.MIN_VALUE)` strikes *AGAIN*, it is a tremendous fun every time. Why not just `RANDOM.nextInt(100)`?
-------------
PR Review: https://git.openjdk.org/jdk/pull/22080#pullrequestreview-2434063567
More information about the hotspot-compiler-dev
mailing list