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

Andrej Pečimúth duke at openjdk.org
Mon Apr 14 12:56:15 UTC 2025


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.

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

Commit messages:
 - Verify bounds for primitive array reads.

Changes: https://git.openjdk.org/jdk/pull/24200/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=24200&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8352724
  Stats: 13 lines in 1 file changed: 10 ins; 3 del; 0 mod
  Patch: https://git.openjdk.org/jdk/pull/24200.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/24200/head:pull/24200

PR: https://git.openjdk.org/jdk/pull/24200


More information about the hotspot-compiler-dev mailing list