RFR: 8341277: Validate slot argument for instruction factories

Chen Liang liach at openjdk.org
Mon Sep 30 23:42:06 UTC 2024


Perform validation of local variable slots, multinewarray dimension, iinc value and specify these validations are performed. Specify these exception behaviors for sipush and bipush as well.

This validation avoids using invalid values that will be lost once class files are written, and avoids invalid value pollution from upstream in chained transformations.

This changes the exception specs of Class-File API, but does not block the JEP as it does not change the intended functionality of these APIs.

Unfortunately, I cannot test the DirectCodeBuilder overloads due to it failing to generate stack maps, so the tests are restricted to instruction factories.

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

Commit messages:
 - slot and some other validation

Changes: https://git.openjdk.org/jdk/pull/21275/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=21275&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8341277
  Stats: 417 lines in 15 files changed: 337 ins; 51 del; 29 mod
  Patch: https://git.openjdk.org/jdk/pull/21275.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/21275/head:pull/21275

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


More information about the core-libs-dev mailing list