Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8232967

Remove bad Code attribute parsing code

    XMLWordPrintable

    Details

    • Type: CSR
    • Status: Closed
    • Priority: P4
    • Resolution: Approved
    • Fix Version/s: 14
    • Component/s: hotspot
    • Labels:
      None
    • Subcomponent:
    • Compatibility Kind:
      behavioral
    • Compatibility Risk:
      minimal
    • Compatibility Risk Description:
      Class files with versions < 45.3 predate Java. It is doubtful if many such class files still exist that have the unspecified layout of Code attribute fields.
    • Interface Kind:
      Class file construct
    • Scope:
      Implementation

      Description

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

        Attachments

          Issue Links

            Activity

              People

              Assignee:
              hseigel Harold Seigel
              Reporter:
              hseigel Harold Seigel
              Reviewed By:
              Lois Foltan
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved: