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

Old verifier erroneously throws VerifyError for casts from int[] to other arrays of small integer types

    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

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

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


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

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

      } // end Class Test

      Expected Output (Windows, x64):
      4 3

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: