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

Split verifier erroneously throws VerifyError for cast from boolean[] to byte[]

    Details

    • Type: Bug
    • Status: Closed
    • Priority: P4
    • Resolution: Not an Issue
    • Affects Version/s: 9
    • Fix Version/s: None
    • Component/s: hotspot
    • Labels:
      None

      Description

      The following test throws VerifyError in the Split Verifier. But, it should not because arrays of primitive types modeled as int are assignable to each other and so are their arrays. So [Z should be assignable to [B.

      Example:
      //Main.java
      public class Main {
          public static void main(String[] args) {
              boolean[] booleans = { true, false };
              byte[] bytes = Test.castToByteArray(booleans);
              System.out.println(bytes[0] + " " + bytes[1]);
          }
      }

      //Test.jasm
      super class Test
      version 49:0
      {


      public Method "<init>":"()V"
      stack 1 locals 1
      {
      aload_0;
      invokespecial Method java/lang/Object."<init>":"()V";
      return;
      }

      public static Method castToByteArray:"([Z)[B"
      stack 1 locals 1
      {
      aload_0;
      areturn;
      }

      } // end Class Test

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: