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

Split Verifier incorrectly throws VerifyError for getstatic of an array field

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: 9
    • Fix Version/s: 9
    • Component/s: hotspot
    • Labels:
    • Subcomponent:
    • Resolved In Build:
      b49

      Backports

        Description

        The split verifier incorrectly throws VerifyError for a getstatic bytecode whose field reference is an array.

        For example, the verifier throws:
        % $JAVA_HOME/bin/java foo
        Exception in thread "main" java.lang.VerifyError: Expecting reference to class in class foo at constant pool index 10
        Exception Details:
          Location:
            foo.main([Ljava/lang/String;)V @0: getstatic
          Reason:
            Invalid type: '[C' (constant pool 10)

        For this:

        Constant pool:

           #3 = Fieldref #36.#37 // "[C".out:Ljava/io/PrintStream;
                             ...
          #36 = Class #55 // "[C"
          #37 = NameAndType #57:#58 // out:Ljava/io/PrintStream;
                              ...
          #55 = Utf8 [C
                               ...
          #57 = Utf8 out
          #58 = Utf8 Ljava/io/PrintStream;

        Code:
                 0: getstatic #3 // Field "[C".out:Ljava/io/PrintStream;

        The old verifier does not throw a VerifyError for this case.

        See attached test case foo.jasm

          Attachments

            Issue Links

              Activity

                People

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

                  Dates

                  Created:
                  Updated:
                  Resolved: