RFR: 8361908: Mix and match of dead and valid exception handler leads to malformed class file

Chen Liang liach at openjdk.org
Thu Jul 10 21:52:49 UTC 2025


Noticed this error when I was verifying all sizes are u2 compatible and verified with a test that fails on mainline with ConstantPoolException (because we write a size of 2 with 1-length list content) and works in this patch. Problem wasn't discovered before because we use the `handlersSize < handlers.size()` instead of `handlersSize != handlers.size()` check.

Testing: jdk/jdk/classfile

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

Commit messages:
 - 8361908: Mix and match of dead and valid exception handler leads to malformed class file

Changes: https://git.openjdk.org/jdk/pull/26255/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=26255&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8361908
  Stats: 22 lines in 2 files changed: 20 ins; 1 del; 1 mod
  Patch: https://git.openjdk.org/jdk/pull/26255.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/26255/head:pull/26255

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


More information about the core-libs-dev mailing list