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

[lworld] MethodHandle invocation should check for VT consistency

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Won't Fix
    • Icon: P3 P3
    • repo-valhalla
    • repo-valhalla
    • hotspot

      See

      http://cr.openjdk.java.net/~iklam/valhalla/tests_for_value_types_consistency_checks.v02/
      http://cr.openjdk.java.net/~iklam/valhalla/tests_for_value_types_consistency_checks.v02/ConsistencyTest.jtr

      In this versions of the test, we have 2 classes that disagree on whether Point is a Value Type:

      class InvokeMethodHandle {
          public static void run() throws Throwable {
              MethodHandles.Lookup lookup = MethodHandles.lookup();
              MethodType mt = MethodType.methodType(Point.class);
              MethodHandle mh = lookup.findStatic(CorrectProvider.class, "getNullPoint", mt);
              InvokeMethodHandle_mismatched.test(mh);
          }
      }

      class InvokeMethodHandle_mismatched {
          static void test(MethodHandle mh) throws Throwable {
              Point p = (Point)mh.invoke();
              System.out.println("(should not get here) Point = " + p);
          }
      }

      mh.invoke should throw an IncompatibleClassChangeException. However, as indicated by the above ConsistencyTest.jtr file, the ICCE was not thrown.

            mchung Mandy Chung (Inactive)
            iklam Ioi Lam
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: