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

jasm: Parsing BSM arguments causes jasm to crash in complex cases

XMLWordPrintable

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

      A combination of a few arguments that have a complex type like MethodType, MethodHandle etc. causes abnormal termination of jasm.
      There is a piece of the jasm code that is wrong from jasm point of view:
       invokedynamic InvokeDynamic REF_invokeStatic:Method java/lang/invoke/LambdaMetafactory.metafactory:"(Ljava/lang/invoke/MethodHandles$Lookup;Ljava/lang/String;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodType;Ljava/lang/invoke/MethodHandle;Ljava/lang/invoke/MethodType;)Ljava/lang/invoke/CallSite;":test:"()Ljava/util/function/Predicate;" {
      MethodType "(Ljava/lang/Object;)Z",
      MethodHandle REF_invokeInterface:InterfaceMethod org/springframework/core/annotation/MergedAnnotation.isPresent:"()Z",
      MethodType "(Lorg/springframework/core/annotation/MergedAnnotation;)Z"
      };

      to reproduce the issue is needed:

      ❯jdis DefaultListableBeanFactory.class > DefaultListableBeanFactory.class.jasm.10
      ❯ jasm DefaultListableBeanFactory.class.jasm.10
      DefaultListableBeanFactory.class.jasm.10 (1213:51) Error: Wrong tag: InterfaceMethod expected.
      MethodHandle REF_invokeInterface:InterfaceMethod org/springframework/core/annotation/MergedAnnotation.isPresent:"()Z",
      ^
      1 error

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

              Created:
              Updated: