RFR: 8352724: Verify bounds for primitive array reads in JVMCI

Doug Simon dnsimon at openjdk.org
Mon Apr 14 12:56:20 UTC 2025


On Mon, 24 Mar 2025 14:31:54 GMT, Andrej Pečimúth <duke at openjdk.org> wrote:

> This PR adds a bounds check for primitive array reads in JVMCI. When a JVMCI compiler attempts to read after the last array element (from the padding of the allocated object), JVMCI should throw an exception instead of returning a garbage value. The check added in this PR handles both primitive and object reads.

LGTM and trival.

Actually, can you please add some extra tests to `TestConstantReflectionProvider.java` for out-of-bounds reads.

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

Marked as reviewed by dnsimon (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24200#pullrequestreview-2764015041
Changes requested by dnsimon (Reviewer).

PR Review: https://git.openjdk.org/jdk/pull/24200#pullrequestreview-2764143284


More information about the graal-dev mailing list