Uploaded image for project: 'Code Tools'
  1. Code Tools
  2. CODETOOLS-7902333

jasm produces inconsistent constant pool data for bootstrap methods of interfaces if cfv >= 52

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: P3 P3
    • asm_tools_7.0
    • asm_tools_7.0
    • tools
    • None
    • b07
    • b07

      The code snippet
      public interface ITestInterfaceA
      version 56:0
      {

      ....
      static Method "<clinit>":"()V"
      stack 2 locals 0
      {
      invokestatic Method java/lang/invoke/MethodHandles.lookup:"()Ljava/lang/invoke/MethodHandles$Lookup;";
      putstatic Field LOOKUP:"Ljava/lang/invoke/MethodHandles$Lookup;";
      ldc Dynamic REF_invokeStatic:ITestInterfaceA.condyBsmIA2:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;I)Ljava/lang/String;":condy:"Ljava/lang/String;" {
      String "Hi",
      int 2
      };
      putstatic Field sfS2:"Ljava/lang/String;";
      return;
       }
      }
      -----------------------
      produces classfile that can't be loaded. Hotspot throws the exception:

      java.lang.IncompatibleClassChangeError: Inconsistent constant pool data in classfile for class javasoft/sqe/tests/api/java/lang/constant/data/ITestInterfaceA. Method condyBsmIA2(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;Ljava/lang/String;I)Ljava/lang/String; at index 42 is CONSTANT_MethodRef and should be CONSTANT_InterfaceMethodRef

            lkuskov Leonid Kuskov
            lkuskov Leonid Kuskov
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: