Skip to content

Commit

Permalink
(WIP) Fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed Jan 6, 2021
1 parent 39797bb commit 5defbc1
Showing 1 changed file with 12 additions and 4 deletions.
Expand Up @@ -20,6 +20,7 @@
import org.objectweb.asm.tree.AbstractInsnNode;
import org.objectweb.asm.tree.JumpInsnNode;
import org.objectweb.asm.tree.LdcInsnNode;
import org.objectweb.asm.tree.MethodInsnNode;
import org.objectweb.asm.tree.MethodNode;
import org.objectweb.asm.tree.TableSwitchInsnNode;

Expand Down Expand Up @@ -67,10 +68,17 @@ private void matchOptimizedTailCall(final MethodNode methodNode,

private void match(final MethodNode methodNode,
final IFilterOutput output) {
cursor = methodNode.instructions.getFirst();
nextIsInvoke(Opcodes.INVOKESTATIC,
"kotlin/coroutines/intrinsics/IntrinsicsKt",
"getCOROUTINE_SUSPENDED", "()Ljava/lang/Object;");
cursor = skipNonOpcodes(methodNode.instructions.getFirst());
if (cursor == null || cursor.getOpcode() != Opcodes.INVOKESTATIC) {
cursor = null;
} else {
final MethodInsnNode m = (MethodInsnNode) cursor;
if (!"kotlin/coroutines/intrinsics/IntrinsicsKt".equals(m.owner)
|| !"getCOROUTINE_SUSPENDED".equals(m.name)
|| !"()Ljava/lang/Object;".equals(m.desc)) {
cursor = null;
}
}

if (cursor == null) {
cursor = skipNonOpcodes(methodNode.instructions.getFirst());
Expand Down

0 comments on commit 5defbc1

Please sign in to comment.