[jdk23] Integrated: 8333748: javap crash - Fatal error: Unmatched bit position 0x2 for location CLASS

2024-06-24 Thread Chen Liang
On Sat, 22 Jun 2024 00:26:51 GMT, Chen Liang  wrote:

> Please review this clean backport of #19708, to make javap recover and 
> continue after encountering undefined access flag bits set while still 
> exiting with a code of error, allowing it to error against improper bits 
> while still providing as much output as possible.

This pull request has now been integrated.

Changeset: a124e6e5
Author:Chen Liang 
URL:   
https://git.openjdk.org/jdk/commit/a124e6e5c7ae7493edd6fe95dde7b21d13af1c8b
Stats: 228 lines in 4 files changed: 168 ins; 44 del; 16 mod

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

Reviewed-by: asotona
Backport-of: 7e55ed3b106ed08956d2d38b7c99fb81704667c9

-

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


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

2024-06-21 Thread Chen Liang
On Thu, 13 Jun 2024 17:50:38 GMT, Chen Liang  wrote:

> 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.

This pull request has now been integrated.

Changeset: 7e55ed3b
Author:Chen Liang 
URL:   
https://git.openjdk.org/jdk/commit/7e55ed3b106ed08956d2d38b7c99fb81704667c9
Stats: 228 lines in 4 files changed: 168 ins; 44 del; 16 mod

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

Reviewed-by: asotona

-

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