RFR: 8352724: Verify bounds for primitive array reads in JVMCI [v3]

Andrej Pečimúth duke at openjdk.org
Mon Apr 14 16:33:07 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.

Andrej Pečimúth has updated the pull request incrementally with one additional commit since the last revision:

  Test array reads that are partially out of bounds.

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

Changes:
  - all: https://git.openjdk.org/jdk/pull/24200/files
  - new: https://git.openjdk.org/jdk/pull/24200/files/7475f468..3661b212

Webrevs:
 - full: https://webrevs.openjdk.org/?repo=jdk&pr=24200&range=02
 - incr: https://webrevs.openjdk.org/?repo=jdk&pr=24200&range=01-02

  Stats: 17 lines in 1 file changed: 16 ins; 0 del; 1 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 graal-dev mailing list