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

VM accepts an illegal method descriptor referred by CONSTANT_InvokeDynamic_info. name_and_type_index

    XMLWordPrintable

Details

    Description

      JCK 11 test classfmt/cpl/cplidc005/cplidc00501m018/cplidc00501m018.html was written for JEP 309.
      It's used to test the following assertions:
      Chapter 4.4.10
      name_and_type_index
        In a CONSTANT_Dynamic_info structure, the indicated descriptor must be a field descriptor (4.3.2).[jvms-4.4.10-200-C.1]
       In a CONSTANT_InvokeDynamic_info structure, the indicated descriptor must be a method descriptor (4.3.3).[jvms-4.4.10-200-C.2]

      The test case cplidc00501m018 is negative and uses the method descriptor "<init>":"(Ljava/lang/String;)Z" to get
      java.lang.ClassFormatError: Method "<init>" in class <NAME> has illegal signature "(Ljava/lang/String;)Z"

      The test was correct for versions JDK 11-17, now it fails with JDK 18, 19 because no exceptions are thrown.

      Attachments

        Issue Links

          Activity

            People

              hseigel Harold Seigel (Inactive)
              lkuskov Leonid Kuskov
              Votes:
              0 Vote for this issue
              Watchers:
              10 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: