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

Excess entries in BootstrapMethods with the same bsm, bsmKind, bsmArgs

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: P3 P3
    • None
    • asm_tools_7.0
    • tools
    • None
    • Fix Understood

      Syntactically equal ldc Dynamic instructions create different entries in BootstrapMethods attribute.
      jasm:
      ....
       public static varargs Method main:"([Ljava/lang/String;)V"
      stack 2 locals 1
        {
      ldc Dynamic REF_newInvokeSpecial:Method LdcConDyTwice."<init>":"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;)V":LdcConDyTwice:"LLdcConDyTwice;";
      pop;
      ldc Dynamic REF_newInvokeSpecial:Method LdcConDyTwice."<init>":"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;)V":LdcConDyTwice:"LLdcConDyTwice;";
      pop;
      ldc Dynamic REF_newInvokeSpecial:Method LdcConDyTwice."<init>":"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/Class;)V":LdcConDyTwice:"LLdcConDyTwice;";
      pop;
      getstatic Field java/lang/System.out:"Ljava/io/PrintStream;";
      ldc String "Executed normally.";
      invokevirtual Method java/io/PrintStream.println:"(Ljava/lang/String;)V";
      return;
       }
      ....
      jasm -> class -> jcod produces:
      .....
      Attr(#29) { // BootstrapMethods
            [] { // bootstrap_methods
              { // bootstrap_method
                #17; // bootstrap_method_ref
                [] { // bootstrap_arguments
                } // bootstrap_arguments
              } // bootstrap_method
              ;
              { // bootstrap_method
                #17; // bootstrap_method_ref
                [] { // bootstrap_arguments
                } // bootstrap_arguments
              } // bootstrap_method
              ;
              { // bootstrap_method
                #17; // bootstrap_method_ref
                [] { // bootstrap_arguments
                } // bootstrap_arguments
              } // bootstrap_method
            }
          } // end BootstrapMethods
      ......





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

              Created:
              Updated: