On Mon, 18 May 2026 08:37:16 GMT, Tobias Hartmann <[email protected]> wrote:
> @rwestrel (thanks!) noticed that flat array loads are control dependent on > the flat-array layout checks, but they are not pinned strongly enough > relative to the range check. New `TestFlatArrayLoadPinning.java` demonstrates > this: With `-XX:+StressGCM`, C2 can schedule one of the field loads from the > flat array to before the range check. When the array index is out of bounds, > compiled code performs an out-of-bounds memory load from the flat array > payload and crashes with a `SIGSEGV` instead of throwing the expected > `ArrayIndexOutOfBoundsException`. > > The fix is to use `C2_UNKNOWN_CONTROL_LOAD` for these loads. > > Thanks, > Tobias > > --------- > - [x] I confirm that I make this contribution in accordance with the [OpenJDK > Interim AI Policy](https://openjdk.org/legal/ai). Marked as reviewed by roland (Committer). ------------- PR Review: https://git.openjdk.org/valhalla/pull/2445#pullrequestreview-4310725463
