Skip to content

Commit

Permalink
(WIP) fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Godin committed Jul 19, 2019
1 parent 01f4e37 commit 2b59fff
Showing 1 changed file with 12 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,7 @@ public void match(final MethodNode methodNode,
}

final Set<AbstractInsnNode> ignore = new HashSet<AbstractInsnNode>();
final int maskVar = Type.getMethodType(methodNode.desc)
.getArgumentTypes().length - (constructor ? 1 : 2);
final int maskVar = maskVar(methodNode.desc, constructor);
while (true) {
if (cursor.getOpcode() != Opcodes.ILOAD) {
break;
Expand All @@ -129,6 +128,17 @@ public void match(final MethodNode methodNode,
output.ignore(i, i);
}
}

private static int maskVar(final String desc, final boolean constructor) {
final Type[] argumentTypes = Type.getMethodType(desc)
.getArgumentTypes();
int slot = 0;
for (int i = 0; i < argumentTypes.length
- (constructor ? 1 : 2); i++) {
slot += argumentTypes[i].getSize();
}
return slot;
}
}

}

0 comments on commit 2b59fff

Please sign in to comment.