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

InterfaceMethod CP entry pointing to a class should cause ICCE

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • 9
    • 9
    • hotspot
    • None
    • b96
    • Fix failed

      The following invoke instructions are successfully executed:
         invokestatic #3; //InterfaceMethod C.foo:()V
         invokestatic #3; //Method I.foo:()V

      where
        class C {...}
        interface I {...}

      JVMS-5.4.3.3 Method Resolution:
       " If C is an interface, method resolution throws an IncompatibleClassChangeError."
      JVMS-5.4.3.4 Interface Method Resolution:
       "If C is not an interface, interface method resolution throws an IncompatibleClassChangeError"

      Test case attached(IntfMethod.java):
      $ java -Xverify:all IntfMethod
      testSpecialIntf: FAILED (no exception)
      testStaticIntf: FAILED (no exception)
      testSpecialClass: FAILED (no exception)
      testStaticClass: FAILED (no exception)

        1. IntfMethod.java
          5 kB
          Vladimir Ivanov
        2. BadInterfaceMethodRef.jasm
          1 kB
          Stanislav Lukyanov
        3. BadMethodRef.jasm
          2 kB
          Stanislav Lukyanov

            minqi Yumin Qi
            vlivanov Vladimir Ivanov
            Votes:
            0 Vote for this issue
            Watchers:
            7 Start watching this issue

              Created:
              Updated:
              Resolved: