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

classfile format checker allows invalid method descriptor in CONSTANT_NameAndType_info in some cases

    Details

    • Subcomponent:
    • Resolved In Build:
      b03
    • CPU:
      generic
    • OS:
      generic

      Backports

        Description

        JVMS section 4.4.6 states as follows:
          ---Excerpt-from-spec---
          CONSTANT_NameAndType_info {
            u1 tag;
            u2 name_index;
            u2 descriptor_index;
          }
          ...

          The items of the CONSTANT_NameAndType_info structure are as follows:
          ...
          descriptor_index

          The value of the descriptor_index item must be a valid index into the
          constant_pool table. The constant_pool entry at that index must be a
          CONSTANT_Utf8_info (4.4.7) structure representing a *valid* field descriptor
          (4.3.2) or method descriptor (4.3.3).
          ---End-of-excerpt---

        However, JVM class format checker does not reject classes with invalid
        (according to Section 4.3.3) method descriptors at the descriptor_index
        in the CONSTANT_NameAndType_info structure (like "(#)V", "(.)V", "(;)V",
        "()V#" or similar) if there are *NO any explicit or implicit references*
        to this NameAndType from a class methods bytecodes.

          Attachments

            Issue Links

              Activity

                People

                • Assignee:
                  kamg Keith Mcguigan
                  Reporter:
                  ygaevsky Yuri Gaevsky
                • Votes:
                  0 Vote for this issue
                  Watchers:
                  2 Start watching this issue

                  Dates

                  • Created:
                    Updated:
                    Resolved:
                    Imported:
                    Indexed: