RFR: JDK-8311076: RedefineClasses doesn't check for ConstantPool overflow

Alex Menkov amenkov at openjdk.org
Wed Feb 7 20:59:16 UTC 2024


The fix adds check that merged constant pool does not overflow u2 (two-byte unsigned).
The check is added after merging `the_class` and `scratch_class` constant pools, but before rewriting constant pool references.

testing:
 - sanity tier1;
 - all RedefineClasses/RetransformClasses tests:
   - test/jdk/java/lang/instrument
   - test/hotspot/jtreg/serviceability/jvmti/RedefineClasses
   - test/hotspot/jtreg/vmTestbase/nsk/jvmti/RedefineClasses
   - test/hotspot/jtreg/vmTestbase/nsk/jvmti/RetransformClasses

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

Commit messages:
 - merge_cp_length overflow check

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

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


More information about the serviceability-dev mailing list