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

VM fails to verify switch statement that includes the last integer

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 1.4.0
    • 1.2.0, 1.3.0, 1.4.0
    • hotspot
    • beta
    • generic, x86
    • generic, linux, solaris_7

      The VM fails to verify the attached class file, which was generated with
      a recent javac. Here is the source:

      class SwitchFence {
          public static final int MEMENTO_NULL = 0x7FFFFFFD;
          public static final int MEMENTO_ALLE = 0x7FFFFFFE;
          public static final int MEMENTO_LEER = 0x7FFFFFFF;

          public static void main(String[] args) throws Exception {
              int i = MEMENTO_LEER;
              switch (i) {
              case MEMENTO_NULL:
                  throw new Exception("fail");

              case MEMENTO_ALLE:
                  throw new Exception("fail");

              case MEMENTO_LEER:
                  break;
              }
          }
      }

            wtaosunw Wei Tao (Inactive)
            gafter Neal Gafter (Inactive)
            Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

              Created:
              Updated:
              Resolved:
              Imported:
              Indexed: