diff --git a/sootup.java.bytecode.frontend/src/main/java/sootup/java/bytecode/frontend/conversion/AsmMethodSource.java b/sootup.java.bytecode.frontend/src/main/java/sootup/java/bytecode/frontend/conversion/AsmMethodSource.java index 03ef38d5afa..6b847d3607c 100644 --- a/sootup.java.bytecode.frontend/src/main/java/sootup/java/bytecode/frontend/conversion/AsmMethodSource.java +++ b/sootup.java.bytecode.frontend/src/main/java/sootup/java/bytecode/frontend/conversion/AsmMethodSource.java @@ -35,6 +35,7 @@ import java.util.stream.Stream; import javax.annotation.Nonnull; import javax.annotation.Nullable; +import org.objectweb.asm.ConstantDynamic; import org.objectweb.asm.Handle; import org.objectweb.asm.commons.JSRInlinerAdapter; import org.objectweb.asm.tree.*; @@ -961,6 +962,20 @@ private Immediate toSootValue(@Nonnull Object val) throws UnsupportedOperationEx JavaJimple.getInstance() .newMethodHandle(toSootFieldSignature((Handle) val), ((Handle) val).getTag()); } + } else if (val instanceof ConstantDynamic) { + ConstantDynamic cd = (ConstantDynamic) val; + if (MethodHandle.isMethodRef(cd.getBootstrapMethod().getTag())) { + v = + JavaJimple.getInstance() + .newMethodHandle( + toMethodSignature(cd.getBootstrapMethod()), cd.getBootstrapMethod().getTag()); + } else { + v = + JavaJimple.getInstance() + .newMethodHandle( + toSootFieldSignature(cd.getBootstrapMethod()), + cd.getBootstrapMethod().getTag()); + } } else { throw new UnsupportedOperationException("Unknown constant type: " + val.getClass()); }