Summary
The JVM currently requires that classes with class file version < 45.3 have a Code attribute whose max_stack and max_locals fields are one byte and attribute length is 2 bytes. This violates the JVM Spec.
Problem
For old class files, the JVM accepts Code attribute fields that violate the JVM Spec. It does not accept Code attribute fields, for these old class files, that conform to the JVM Spec.
Solution
The solution is to remove the code from the JVM that incorrectly handles the Code attribute for the old class file versions.
Specification
The JVM's handling of Code attributes for class files with version <= 45.2 should match section 4.7.3 of the Java Virtual Machine Spec, which describes the Code attribute as:
Code_attribute { u2 attribute_name_index; u4 attribute_length; u2 max_stack; u2 max_locals; ... }
- csr of
-
JDK-8232890 Remove bad Code attribute parsing code
- Resolved