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

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: P3
    • Resolution: Fixed
    • Affects Version/s: asm_tools_7.0
    • Fix Version/s: asm_tools_7.0
    • Component/s: tools
    • Labels:
      None
    • Subcomponent:
    • Introduced In Build:
      b07
    • Resolved In Build:
      b07

      Description

      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

        Attachments

          Issue Links

            Activity

              People

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

                Dates

                • Created:
                  Updated:
                  Resolved: