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

Split Verifier incorrectly throws VerifyError for getstatic of an array field

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • b49

        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

              hseigel Harold Seigel (Inactive)
              hseigel Harold Seigel (Inactive)
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: