Currently, javap crashes for class files that have set non-zero values for 
undefined access flag bits, as `java.lang.reflect.AccessFlag.maskToAccessFlag` 
and `java.lang.classfile.AccessFlags.flags` fail. In contrast, the JVMS, though 
asking for these bits to be set to 0, requires VM to proceed and ignore these 
bits. javap should emulate the VM behavior and proceed rendering, ignoring 
these undefined bits.

In addition, a few bytecode generation utilities in the JDK set unused bits, 
such as in 
`java.lang.invoke.MethodHandleImpl.BindCaller#generateInvokerTemplate` and 
`java.lang.invoke.GenerateJLIClassesHelper#generateCodeBytesForLFs`. Those can 
be updated in a later cleanup.

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

Commit messages:
 - 8333748: javap crash - Fatal error: Unmatched bit position 0x2 for location 
CLASS

Changes: https://git.openjdk.org/jdk/pull/19708/files
  Webrev: https://webrevs.openjdk.org/?repo=jdk&pr=19708&range=00
  Issue: https://bugs.openjdk.org/browse/JDK-8333748
  Stats: 156 lines in 3 files changed: 104 ins; 21 del; 31 mod
  Patch: https://git.openjdk.org/jdk/pull/19708.diff
  Fetch: git fetch https://git.openjdk.org/jdk.git pull/19708/head:pull/19708

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

Reply via email to